Loading lib/jsduck/doc_parser.rb +11 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ module JsDuck at_xtype elsif look(/@member\b/) at_member elsif look(/@author\b/) at_author elsif look(/@static\b/) boolean_at_tag(/@static/, :static) elsif look(/@(private|ignore|hide|protected)\b/) Loading Loading @@ -207,6 +209,15 @@ module JsDuck skip_white end # matches @author some name ... newline def at_author match(/@author/) add_tag(:author) skip_horiz_white @current_tag[:name] = @input.scan(/.*$/) skip_white end # Used to match @private, @ignore, @hide, ... def boolean_at_tag(regex, propname) match(regex) Loading lib/jsduck/merger.rb +5 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ module JsDuck :extends => detect_extends(doc_map, code), :mixins => detect_mixins(doc_map, code), :xtype => detect_xtype(doc_map), :author => detect_author(doc_map), :singleton => !!doc_map[:singleton], :private => !!doc_map[:private], } Loading Loading @@ -235,6 +236,10 @@ module JsDuck doc_map[:xtype] ? doc_map[:xtype].first[:name] : nil end def detect_author(doc_map) doc_map[:author] ? doc_map[:author].first[:name] : nil end def detect_params(docs, code) implicit = detect_implicit_params(code) explicit = detect_explicit_params(docs) Loading lib/jsduck/page.rb +1 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ module JsDuck abstract_row("Defind In:", file_link), @subclasses[@cls] ? abstract_row("Subclasses:", subclasses) : "", @cls[:xtype] ? abstract_row("xtype:", @cls[:xtype]) : "", @cls[:author] ? abstract_row("Author:", @cls[:author]) : "", "</table>", ].join("\n") end Loading spec/aggregator_classes_spec.rb +17 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,23 @@ describe JsDuck::Aggregator do end end describe "class with @author" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @author John Doe * Comment here. */ EOS end it_should_behave_like "class" it "detects author name" do @doc[:author].should == "John Doe" end end describe "member docs after class doc" do before do @classes = parse(<<-EOS) Loading Loading
lib/jsduck/doc_parser.rb +11 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ module JsDuck at_xtype elsif look(/@member\b/) at_member elsif look(/@author\b/) at_author elsif look(/@static\b/) boolean_at_tag(/@static/, :static) elsif look(/@(private|ignore|hide|protected)\b/) Loading Loading @@ -207,6 +209,15 @@ module JsDuck skip_white end # matches @author some name ... newline def at_author match(/@author/) add_tag(:author) skip_horiz_white @current_tag[:name] = @input.scan(/.*$/) skip_white end # Used to match @private, @ignore, @hide, ... def boolean_at_tag(regex, propname) match(regex) Loading
lib/jsduck/merger.rb +5 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,7 @@ module JsDuck :extends => detect_extends(doc_map, code), :mixins => detect_mixins(doc_map, code), :xtype => detect_xtype(doc_map), :author => detect_author(doc_map), :singleton => !!doc_map[:singleton], :private => !!doc_map[:private], } Loading Loading @@ -235,6 +236,10 @@ module JsDuck doc_map[:xtype] ? doc_map[:xtype].first[:name] : nil end def detect_author(doc_map) doc_map[:author] ? doc_map[:author].first[:name] : nil end def detect_params(docs, code) implicit = detect_implicit_params(code) explicit = detect_explicit_params(docs) Loading
lib/jsduck/page.rb +1 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,7 @@ module JsDuck abstract_row("Defind In:", file_link), @subclasses[@cls] ? abstract_row("Subclasses:", subclasses) : "", @cls[:xtype] ? abstract_row("xtype:", @cls[:xtype]) : "", @cls[:author] ? abstract_row("Author:", @cls[:author]) : "", "</table>", ].join("\n") end Loading
spec/aggregator_classes_spec.rb +17 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,23 @@ describe JsDuck::Aggregator do end end describe "class with @author" do before do @doc = parse(<<-EOS)[0] /** * @class MyClass * @author John Doe * Comment here. */ EOS end it_should_behave_like "class" it "detects author name" do @doc[:author].should == "John Doe" end end describe "member docs after class doc" do before do @classes = parse(<<-EOS) Loading