Loading lib/jsduck/ast.rb +2 −3 Original line number Diff line number Diff line Loading @@ -195,8 +195,7 @@ module JsDuck cls[:singleton] = make_singleton(cfg["singleton"]) cls[:aliases] = make_string_list(cfg["alias"]) cls[:aliases] += make_string_list(cfg["xtype"]).map {|xtype| "widget."+xtype } cls[:members] = {} cls[:members][:cfg] = make_configs(cfg["config"]) cls[:members] = make_configs(cfg["config"]) end end Loading Loading @@ -233,7 +232,7 @@ module JsDuck end def make_configs(ast) return [] unless ast && ast["type"] == "ObjectExpression" return nil unless ast && ast["type"] == "ObjectExpression" configs = [] Loading lib/jsduck/class_doc_grouper.rb +8 −10 Original line number Diff line number Diff line Loading @@ -77,8 +77,7 @@ module JsDuck # Turn all auto-detected members into separate docsets if docset[:code] && docset[:code][:members] docset[:code][:members].each_pair do |type, members| members.each do |m| docset[:code][:members].each do |m| results << { :tagname => m[:tagname], :type => :no_comment, Loading @@ -88,7 +87,6 @@ module JsDuck } end end end results end Loading spec/ast_cfg_spec.rb +7 −13 Original line number Diff line number Diff line Loading @@ -20,27 +20,21 @@ describe "JsDuck::Ast detecting" do EOS end it "adds :members as hash" do members.should be_kind_of(Hash) it "adds :members as array" do members.should be_kind_of(Array) end let(:cfg) { members[:cfg] } it "finds :cfg as array" do cfg.should be_kind_of(Array) end it "finds two cfgs with :cfg tagname" do cfg[0][:tagname].should == :cfg cfg[1][:tagname].should == :cfg it "finds two cfgs" do members[0][:tagname].should == :cfg members[1][:tagname].should == :cfg end it "finds cfg foo" do cfg[0][:name].should == "foo" members[0][:name].should == "foo" end it "finds cfg bar" do cfg[1][:name].should == "bar" members[1][:name].should == "bar" end end Loading Loading
lib/jsduck/ast.rb +2 −3 Original line number Diff line number Diff line Loading @@ -195,8 +195,7 @@ module JsDuck cls[:singleton] = make_singleton(cfg["singleton"]) cls[:aliases] = make_string_list(cfg["alias"]) cls[:aliases] += make_string_list(cfg["xtype"]).map {|xtype| "widget."+xtype } cls[:members] = {} cls[:members][:cfg] = make_configs(cfg["config"]) cls[:members] = make_configs(cfg["config"]) end end Loading Loading @@ -233,7 +232,7 @@ module JsDuck end def make_configs(ast) return [] unless ast && ast["type"] == "ObjectExpression" return nil unless ast && ast["type"] == "ObjectExpression" configs = [] Loading
lib/jsduck/class_doc_grouper.rb +8 −10 Original line number Diff line number Diff line Loading @@ -77,8 +77,7 @@ module JsDuck # Turn all auto-detected members into separate docsets if docset[:code] && docset[:code][:members] docset[:code][:members].each_pair do |type, members| members.each do |m| docset[:code][:members].each do |m| results << { :tagname => m[:tagname], :type => :no_comment, Loading @@ -88,7 +87,6 @@ module JsDuck } end end end results end Loading
spec/ast_cfg_spec.rb +7 −13 Original line number Diff line number Diff line Loading @@ -20,27 +20,21 @@ describe "JsDuck::Ast detecting" do EOS end it "adds :members as hash" do members.should be_kind_of(Hash) it "adds :members as array" do members.should be_kind_of(Array) end let(:cfg) { members[:cfg] } it "finds :cfg as array" do cfg.should be_kind_of(Array) end it "finds two cfgs with :cfg tagname" do cfg[0][:tagname].should == :cfg cfg[1][:tagname].should == :cfg it "finds two cfgs" do members[0][:tagname].should == :cfg members[1][:tagname].should == :cfg end it "finds cfg foo" do cfg[0][:name].should == "foo" members[0][:name].should == "foo" end it "finds cfg bar" do cfg[1][:name].should == "bar" members[1][:name].should == "bar" end end Loading