2009-06-29 12:18:55 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rake'
|
2009-09-26 20:12:51 -04:00
|
|
|
require 'fileutils'
|
|
|
|
require 'pathname'
|
2009-06-29 12:18:55 -04:00
|
|
|
|
|
|
|
begin
|
2009-09-30 11:19:25 -04:00
|
|
|
# require 'jeweler'
|
|
|
|
# Jeweler::Tasks.new do |gem|
|
|
|
|
# gem.name = "rspec-meta"
|
|
|
|
# gem.summary = "pulls in the other rspec gems"
|
|
|
|
# gem.email = "dchelimsky@gmail.com;chad.humphries@gmail.com"
|
|
|
|
# gem.homepage = "http://github.com/rspec/meta"
|
|
|
|
# gem.authors = ["David Chelimsky", "Chad Humphries"]
|
|
|
|
# gem.add_dependency "rspec-core", ">= 2.0.0.a1"
|
|
|
|
# gem.add_dependency "rspec-expectations", ">= 2.0.0.a1"
|
|
|
|
# gem.add_dependency "rspec-mocks", ">= 2.0.0.a1"
|
|
|
|
# gem.add_development_dependency 'git'
|
2009-06-29 12:18:55 -04:00
|
|
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
2009-09-30 11:19:25 -04:00
|
|
|
# end
|
2009-10-09 10:23:59 -04:00
|
|
|
# Jeweler::GemcutterTasks.new
|
2009-06-29 12:18:55 -04:00
|
|
|
rescue LoadError
|
|
|
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
|
|
|
end
|
|
|
|
|
2009-09-30 11:19:25 -04:00
|
|
|
def run_command(command)
|
2009-09-26 20:12:51 -04:00
|
|
|
base_rspec2_path = Pathname.new(Dir.pwd.split('meta').first)
|
|
|
|
['meta', 'core', 'expectations', 'mocks'].each do |dir|
|
|
|
|
path = base_rspec2_path.join(dir)
|
|
|
|
puts "====================================="
|
|
|
|
puts "Running [#{command}] in #{path}"
|
|
|
|
puts "====================================="
|
2009-09-30 11:19:25 -04:00
|
|
|
FileUtils.cd(path) do
|
2009-09-26 20:12:51 -04:00
|
|
|
system command
|
|
|
|
end
|
|
|
|
puts
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-09-21 22:10:37 -05:00
|
|
|
task :clobber do
|
|
|
|
rm_rf 'pkg'
|
|
|
|
end
|
|
|
|
|
2009-06-29 13:55:31 -04:00
|
|
|
task :spec do
|
2009-09-30 11:19:25 -04:00
|
|
|
run_command 'rake'
|
2009-06-29 12:18:55 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
task :default => :spec
|
|
|
|
|
2009-06-29 14:08:54 -04:00
|
|
|
namespace :git do
|
2009-09-30 11:19:25 -04:00
|
|
|
|
|
|
|
{ :status => nil,
|
|
|
|
:pull => '--rebase',
|
|
|
|
:push => nil,
|
|
|
|
:reset => '--hard',
|
|
|
|
:diff => nil
|
|
|
|
}.each do |command, options|
|
2009-06-29 14:49:02 -04:00
|
|
|
desc "git #{command} on all the repos"
|
2009-10-02 00:04:18 -04:00
|
|
|
task command => :clone do
|
2009-09-30 11:19:25 -04:00
|
|
|
run_command "git #{command} #{options}".strip
|
2009-06-29 14:08:54 -04:00
|
|
|
end
|
|
|
|
end
|
2009-07-01 08:42:58 -04:00
|
|
|
|
|
|
|
task :st => :status
|
2009-10-02 00:04:18 -04:00
|
|
|
|
|
|
|
desc "git clone all the repos the first time"
|
|
|
|
task :clone do
|
|
|
|
base_rspec2_path = Pathname.new(Dir.pwd.split('meta').first)
|
|
|
|
FileUtils.cd(base_rspec2_path) do
|
|
|
|
['core', 'expectations', 'mocks'].each do |repo|
|
|
|
|
unless File.exists?(repo)
|
|
|
|
system "git clone git://github.com/rspec/#{repo}.git"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2009-06-29 14:08:54 -04:00
|
|
|
end
|