Loading lib/jsduck/aggregator.rb +3 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,9 @@ module JsDuck # Creates classes for orphans that have :owner property defined, # and then inserts orphans to these classes. def classify_orphans @orphans.each do |orph| # Clone the orphans array first to avoid problems with # #inster_orphan method deleting items from @orphans array. @orphans.clone.each do |orph| if orph[:owner] class_name = orph[:owner] if !@classes[class_name] Loading lib/jsduck/web/search.rb +5 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module JsDuck # add all local members, but skip constructors cls[:members].each do |m| list << member_node(m, cls) unless m[:name] == ClassName.short(cls[:name]) list << member_node(m, cls) unless m[:hide] || constructor?(m) end end Loading @@ -44,6 +44,10 @@ module JsDuck private def constructor?(m) m[:tagname] == :method && m[:name] == "constructor" end def alias_node(key, name, cls) return { :name => name, Loading spec/aggregator_members_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,20 @@ describe JsDuck::Aggregator do end end it "creates classes for all orphans with @member defined" do classes = parse(<<-EOS) /** * @cfg foo * @member FooCls */ /** * @cfg bar * @member BarCls */ EOS classes["FooCls"][:members].length.should == 1 classes["BarCls"][:members].length.should == 1 end end Loading
lib/jsduck/aggregator.rb +3 −1 Original line number Diff line number Diff line Loading @@ -158,7 +158,9 @@ module JsDuck # Creates classes for orphans that have :owner property defined, # and then inserts orphans to these classes. def classify_orphans @orphans.each do |orph| # Clone the orphans array first to avoid problems with # #inster_orphan method deleting items from @orphans array. @orphans.clone.each do |orph| if orph[:owner] class_name = orph[:owner] if !@classes[class_name] Loading
lib/jsduck/web/search.rb +5 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ module JsDuck # add all local members, but skip constructors cls[:members].each do |m| list << member_node(m, cls) unless m[:name] == ClassName.short(cls[:name]) list << member_node(m, cls) unless m[:hide] || constructor?(m) end end Loading @@ -44,6 +44,10 @@ module JsDuck private def constructor?(m) m[:tagname] == :method && m[:name] == "constructor" end def alias_node(key, name, cls) return { :name => name, Loading
spec/aggregator_members_spec.rb +16 −0 Original line number Diff line number Diff line Loading @@ -49,4 +49,20 @@ describe JsDuck::Aggregator do end end it "creates classes for all orphans with @member defined" do classes = parse(<<-EOS) /** * @cfg foo * @member FooCls */ /** * @cfg bar * @member BarCls */ EOS classes["FooCls"][:members].length.should == 1 classes["BarCls"][:members].length.should == 1 end end