Skip to content

Commit

Permalink
Fix parsing of superclasses in CRuby docs
Browse files Browse the repository at this point in the history
Fixes #1079
  • Loading branch information
lsegal committed Apr 24, 2017
1 parent 46d638a commit e91d41c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/yard/handlers/c/class_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class YARD::Handlers::C::ClassHandler < YARD::Handlers::C::Base
handle_class(var_name, class_name, parent)
end
statement.source.scan(MATCH2) do |var_name, in_module, class_name, parent|
handle_class(var_name, class_name, parent, in_module)
handle_class(var_name, class_name, parent.strip, in_module)
end
end
end
3 changes: 2 additions & 1 deletion spec/handlers/c/class_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
it "registers classes under namespaces" do
parse_init <<-EOF
cBar = rb_define_class("Bar", rb_cObject);
cFoo = rb_define_class_under(cBar, "Foo", rb_cObject);
cFoo = rb_define_class_under( cBar, "Foo", rb_cBaz );
EOF
expect(Registry.at('Bar::Foo').type).to eq :class
expect(Registry.at('Bar::Foo').superclass.path).to eq 'Baz'
end

it "remembers symbol defined with class" do
Expand Down

0 comments on commit e91d41c

Please sign in to comment.