From ac2fa8ef263d25c397a441b9c0740c81d54a6eca Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 26 Feb 2013 22:39:24 +1100 Subject: [PATCH] fix rake task for ruby 1.8 --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 8ead3d86be..6431c716a4 100644 --- a/Rakefile +++ b/Rakefile @@ -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