Loading lib/jsduck/accessors.rb +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ module JsDuck :owner => cfg[:owner], :files => cfg[:files], :private => cfg[:private], :autodetected => cfg[:autodetected], :meta => clone_meta(cfg), }) end Loading lib/jsduck/ast.rb +1 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ module JsDuck docset[:code] = cfg else cfg[:inheritdoc] = {} cfg[:accessor] = true cfg[:autodetected] = true configs << cfg end Loading lib/jsduck/inherit_doc.rb +4 −4 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ module JsDuck @relations.each do |cls| resolve_class(cls) if cls[:inheritdoc] cls.all_local_members.each do |member| if member[:inheritdoc] if member[:inheritdoc] || member[:autodetected] resolve(member) end end Loading @@ -27,7 +27,7 @@ module JsDuck def resolve(m) parent = find_parent(m) if parent if m[:inheritdoc] && parent m[:doc] = (m[:doc] + "\n\n" + parent[:doc]).strip m[:params] = parent[:params] if parent[:params] m[:return] = parent[:return] if parent[:return] Loading @@ -51,7 +51,7 @@ module JsDuck # # If the parent also has @inheritdoc, continues recursively. def find_parent(m) inherit = m[:inheritdoc] inherit = m[:inheritdoc] || {} if inherit[:cls] # @inheritdoc MyClass#member parent_cls = @relations[m[:inheritdoc][:cls]] Loading Loading @@ -100,7 +100,7 @@ module JsDuck end def lookup_member(cls, m) inherit = m[:inheritdoc] inherit = m[:inheritdoc] || {} cls.get_members(inherit[:member] || m[:name], inherit[:type] || m[:tagname], inherit[:static] || m[:meta][:static])[0] end Loading spec/aggregator_cfg_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ describe JsDuck::Aggregator do cfg[0][:inheritdoc].should == {} end it "sets :accessor flag on config" do cfg[0][:accessor].should == true end it "sets :autodetected flag on config" do cfg[0][:autodetected].should == true end Loading Loading
lib/jsduck/accessors.rb +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ module JsDuck :owner => cfg[:owner], :files => cfg[:files], :private => cfg[:private], :autodetected => cfg[:autodetected], :meta => clone_meta(cfg), }) end Loading
lib/jsduck/ast.rb +1 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ module JsDuck docset[:code] = cfg else cfg[:inheritdoc] = {} cfg[:accessor] = true cfg[:autodetected] = true configs << cfg end Loading
lib/jsduck/inherit_doc.rb +4 −4 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ module JsDuck @relations.each do |cls| resolve_class(cls) if cls[:inheritdoc] cls.all_local_members.each do |member| if member[:inheritdoc] if member[:inheritdoc] || member[:autodetected] resolve(member) end end Loading @@ -27,7 +27,7 @@ module JsDuck def resolve(m) parent = find_parent(m) if parent if m[:inheritdoc] && parent m[:doc] = (m[:doc] + "\n\n" + parent[:doc]).strip m[:params] = parent[:params] if parent[:params] m[:return] = parent[:return] if parent[:return] Loading @@ -51,7 +51,7 @@ module JsDuck # # If the parent also has @inheritdoc, continues recursively. def find_parent(m) inherit = m[:inheritdoc] inherit = m[:inheritdoc] || {} if inherit[:cls] # @inheritdoc MyClass#member parent_cls = @relations[m[:inheritdoc][:cls]] Loading Loading @@ -100,7 +100,7 @@ module JsDuck end def lookup_member(cls, m) inherit = m[:inheritdoc] inherit = m[:inheritdoc] || {} cls.get_members(inherit[:member] || m[:name], inherit[:type] || m[:tagname], inherit[:static] || m[:meta][:static])[0] end Loading
spec/aggregator_cfg_spec.rb +4 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,10 @@ describe JsDuck::Aggregator do cfg[0][:inheritdoc].should == {} end it "sets :accessor flag on config" do cfg[0][:accessor].should == true end it "sets :autodetected flag on config" do cfg[0][:autodetected].should == true end Loading