public
Description: PLEASE GO TO http://yard.soen.ca FOR IMPORTANT NEWS ABOUT YARD / THE AUTHOR!!!
Homepage: http://yard.soen.ca / IRC: #yard on irc.freenode.net
Clone URL: git://github.com/lsegal/yard.git
Click here to lend your support to: yard and make a donation at www.pledgie.com !
Refactor create_tag out of parse_comments
lsegal (author)
Tue Jul 01 22:05:50 -0700 2008
commit  24ca43a0e9b6e68a5bd22555eb98dc02d8068674
tree    167efe26d5874312cd7d09bf4d0923ad69e1f525
parent  713f607d521de0cdfed788c0d318a3bee8af3490
...
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55
56
57
58
 
59
60
 
 
 
61
62
63
...
76
77
78
79
80
81
82
83
84
85
86
87
88
 
89
90
91
...
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
 
74
75
76
77
78
79
80
81
82
...
95
96
97
 
 
 
 
 
 
 
 
 
 
98
99
100
101
0
@@ -51,13 +51,32 @@ module YARD
0
     end
0
     
0
     private
0
+
0
+ ##
0
+ # Creates a tag from the TagFactory
0
+ #
0
+ def create_tag(tag_name, tag_buf, raw_buf)
0
+ tag_method = "#{tag_name}_tag"
0
+ if tag_name && @tag_factory.respond_to?(tag_method)
0
+ if @tag_factory.method(tag_method).arity == 2
0
+ @tags << @tag_factory.send(tag_method, tag_buf, raw_buf.join("\n"))
0
+ else
0
+ @tags << @tag_factory.send(tag_method, tag_buf)
0
+ end
0
+ else
0
+ log.warn "Unknown tag @#{tag_name} in documentation for `#{path}`"
0
+ end
0
+ end
0
 
0
     ##
0
     # Parses out comments split by newlines into a new code object
0
     #
0
- # @param [Array<String>, String] comments
0
+ # @param [String] comments
0
     # the newline delimited array of comments. If the comments
0
     # are passed as a String, they will be split by newlines.
0
+ #
0
+ # @return [String] the non-metadata portion of the comments to
0
+ # be used as a docstring
0
     def parse_comments(comments)
0
       return '' if !comments || comments.empty?
0
       meta_match = /^@(\S+)\s*(.*)/
0
@@ -76,16 +95,7 @@ module YARD
0
 
0
         if tag_name && (((indent < orig_indent && !empty) || done) ||
0
             (indent <= last_indent && line =~ meta_match))
0
- tag_method = "#{tag_name}_tag"
0
- if tag_name && @tag_factory.respond_to?(tag_method)
0
- if @tag_factory.method(tag_method).arity == 2
0
- @tags << @tag_factory.send(tag_method, tag_buf, raw_buf.join("\n"))
0
- else
0
- @tags << @tag_factory.send(tag_method, tag_buf)
0
- end
0
- else
0
- log.warn "Unknown tag @#{tag_name} in documentation for `#{path}`"
0
- end
0
+ create_tag(tag_name, tag_buf, raw_buf)
0
           tag_name, tag_buf, raw_buf = nil, '', []
0
           orig_indent = 0
0
         end

Comments

    No one has commented yet.