mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
fix rake task for ruby 1.8
This commit is contained in:
parent
14ee09549e
commit
2a3ee2dc88
1 changed files with 2 additions and 1 deletions
3
Rakefile
3
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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue