lib/lazydoc/comment.rb in lazydoc-0.3.0 vs lib/lazydoc/comment.rb in lazydoc-0.3.1
- old
+ new
@@ -219,18 +219,18 @@
# c.comment # => "this is the content of the comment for method_two"
#
# As shown in the examples, the dynamically determined line_number
# overwrites the Regexp or Proc.
def parse_up(str, lines=nil, skip_subject=true)
- parse(str, lines) do |n, lines|
+ parse(str, lines) do |n, comment_lines|
# remove whitespace lines
n -= 1 if skip_subject
- n -= 1 while n >=0 && lines[n].strip.empty?
+ n -= 1 while n >=0 && comment_lines[n].strip.empty?
# put together the comment
while n >= 0
- line = lines[n]
+ line = comment_lines[n]
break if block_given? && yield(line)
break unless prepend(line)
n -= 1
end
end
@@ -258,15 +258,15 @@
# c.parse_down(document)
# c.line_number # => 5
# c.comment # => "documentation for section two"
#
def parse_down(str, lines=nil, skip_subject=true)
- parse(str, lines) do |n, lines|
+ parse(str, lines) do |n, comment_lines|
# skip the subject line
n += 1 if skip_subject
# put together the comment
- while line = lines[n]
+ while line = comment_lines[n]
break if block_given? && yield(line)
break unless append(line)
n += 1
end
end