Skip to content

Commit e550fcb

Browse files
committed
Clean up code a bit
1 parent ef4719d commit e550fcb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

rake/doc.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ class Doc
1919

2020
def file_content(filename)
2121
@fc ||= {}
22-
return @fc[filename] if @fc.key?(filename)
23-
24-
comments = []
25-
IO.readlines(filename).each do |line|
26-
next if line =~ /^#\s*@/
27-
next if line.strip == '# frozen_string_literal: true'
28-
if line =~ /^#(.+)/
29-
comments << Regexp.last_match(1).strip
30-
elsif line =~ /^OctocatalogDiff::/
31-
break
22+
@fc[filename] ||= begin
23+
comments = []
24+
IO.readlines(filename).each do |line|
25+
next if line =~ /^#\s*@/
26+
next if line.strip == '# frozen_string_literal: true'
27+
if line =~ /^#(.+)/
28+
comments << Regexp.last_match(1).strip
29+
elsif line =~ /^OctocatalogDiff::/
30+
break
31+
end
3232
end
33+
comments.join("\n")
3334
end
34-
@fc[filename] = comments.join("\n")
3535
end
3636

3737
def initialize

0 commit comments

Comments
 (0)