Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
some rake tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Mar 29, 2011
1 parent e180dca commit ea5e8b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
doc/
20 changes: 20 additions & 0 deletions Rakefile
@@ -0,0 +1,20 @@
desc "run specs"
task(:spec) { ruby '-S rspec spec' }
task(:test => :spec)

namespace :doc do
task :readmes do
Dir.glob 'lib/sinatra/*.rb' do |file|
next if file == 'lib/sinatra/contrib.rb'
doc = File.read(file)[/^module Sinatra\n( #[^\n]*\n)*/m].scan(/^ *#(?!#) ?(.*)\n/).join("\n")
file = "doc/#{file[4..-4].tr("/_", "-")}.rdoc"
File.mkdir "doc" unless File.directory? "doc"
puts "writing #{file}"
File.open(file, "w") { |f| f << doc }
end
end

task :all => [:readmes]
end

task :doc => 'doc:all'

0 comments on commit ea5e8b1

Please sign in to comment.