Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

some rake tasks

  • Loading branch information...
commit ea5e8b1ee6ea0b68a0915f6a5b2fe9d021718e3c 1 parent e180dca
@rkh rkh authored
Showing with 21 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +20 −0 Rakefile
View
1  .gitignore
@@ -0,0 +1 @@
+doc/
View
20 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'
Please sign in to comment.
Something went wrong with that request. Please try again.