mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
ignore white lines when extracting docs
This commit is contained in:
parent
db984c336e
commit
60eba15e1f
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ namespace :doc do
|
|||
Dir.glob 'lib/sinatra/*.rb' do |file|
|
||||
excluded_files = %w[lib/sinatra/contrib.rb lib/sinatra/capture.rb lib/sinatra/engine_tracking.rb]
|
||||
next if excluded_files.include?(file)
|
||||
doc = File.read(file)[/^module Sinatra\n( #[^\n]*\n)*/m].scan(/^ *#(?!#) ?(.*)\n/).join("\n")
|
||||
doc = File.read(file)[/^module Sinatra(\n)+( #[^\n]*\n)*/m].scan(/^ *#(?!#) ?(.*)\n/).join("\n")
|
||||
file = "doc/#{file[4..-4].tr("/_", "-")}.rdoc"
|
||||
Dir.mkdir "doc" unless File.directory? "doc"
|
||||
puts "writing #{file}"
|
||||
|
|
Loading…
Add table
Reference in a new issue