Permalink
Browse files

added rake tasks for staying on the edge of Sinatra

  • Loading branch information...
1 parent b2e3cfa commit 21f9cb932787a623a798a3ab78317a94b1da93bf @nakajima committed Jan 8, 2009
Showing with 33 additions and 2 deletions.
  1. +2 −1 .gitignore
  2. +31 −1 Rakefile
View
@@ -1 +1,2 @@
-*.sqlite3
+*.sqlite3
+vendor/*
View
@@ -1,9 +1,39 @@
require 'spec/rake/spectask'
+require 'rake/classic_namespace'
task :default => [:spec]
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.spec_opts = ['--colour']
-end
+end
+
+namespace :sinatra do
+ desc "Clone edge Sinatra"
+ task :clone do
+ vendor_dir = File.join(File.dirname(__FILE__), 'vendor')
+ FileUtils.mkdir_p(vendor_dir)
+ puts "* cloning git://github.com/rtomayko/sinatra.git"
+ system("git clone git://github.com/rtomayko/sinatra.git #{File.expand_path(vendor_dir)}/sinatra")
+ puts "* done."
+ end
+
+ desc "Update edge Sinatra"
+ task :pull do
+ sinatra_dir = File.join(File.dirname(__FILE__), 'vendor', 'sinatra')
+ Task["sinatra:clone"].invoke unless File.exists?(sinatra_dir)
+
+ puts "* pulling from git://github.com/rtomayko/sinatra.git"
+ system("cd #{File.expand_path(sinatra_dir)} && git pull git://github.com/rtomayko/sinatra.git master")
+ puts "* done."
+ end
+
+ desc "Install edge Sinatra"
+ task :install => :pull do
+ sinatra_dir = File.join(File.dirname(__FILE__), 'vendor', 'sinatra')
+ Task["sinatra:clone"].invoke unless File.exists?(sinatra_dir)
+ puts "* installing edge sinatra"
+ system("cd #{File.expand_path(sinatra_dir)} && rake install")
+ end
+end

0 comments on commit 21f9cb9

Please sign in to comment.