Navigation Menu

Skip to content

Commit

Permalink
fix rake task for ruby 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh authored and kgrz committed Feb 26, 2013
1 parent c6dc58f commit ac2fa8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rakefile
Expand Up @@ -135,8 +135,9 @@ task :toc, [:readme] do |t, a|
end

puts "* [Sinatra](#sinatra)"
title = Regexp.new('(?<=\* )(.*)') # so Ruby 1.8 doesn't complain
File.binread(a.readme).scan(/^##.*/) do |line|
puts line.gsub(/#(?=#)/, ' ').gsub('#', '*').gsub(/(?<=\* )(.*)/) { "[#{$1}](##{link($1)})" }
puts line.gsub(/#(?=#)/, ' ').gsub('#', '*').gsub(title) { "[#{$1}](##{link($1)})" }
end
end

Expand Down

0 comments on commit ac2fa8e

Please sign in to comment.