1
0
Fork 0
mirror of https://github.com/rspec/rspec-metagem.git synced 2022-11-09 12:09:29 -05:00
rspec--rspec-metagem/Rakefile
Chad Humphries, Nick Ang and Rob Sanheim 8e6a2af13b Fixing rake git:something
Turns out their was a ENV key being set by jeweler that was causing
  the issue.  All fixed now
2009-09-26 20:12:51 -04:00

61 lines
1.7 KiB
Ruby

require 'rubygems'
require 'rake'
require 'fileutils'
require 'pathname'
begin
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 is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
def arbitrary_command(command)
# Jeweler sets some ENV keys for GIT that cause our normal flow to explode
ENV.keys.grep(/GIT/).each { |k| ENV.delete(k) }
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 "====================================="
if command.include?('git')
system command.sub(/^git/, "git --git-dir=#{path}/.git --work-tree=#{path}")
else
system command
end
puts
end
end
task :clobber do
rm_rf 'pkg'
end
task :spec do
arbitrary_command('rake')
end
task :default => :spec
namespace :git do
[:status, :pull, :push, :reset, :diff].each do |key|
command = key == :reset ? "reset --hard" : key.to_s
desc "git #{command} on all the repos"
task key do
arbitrary_command("git #{command}")
end
end
task :st => :status
end