mirror of
https://github.com/rspec/rspec-metagem.git
synced 2022-11-09 12:09:29 -05:00
Fixing rake git:something
Turns out their was a ENV key being set by jeweler that was causing the issue. All fixed now
This commit is contained in:
parent
6f728d3404
commit
8e6a2af13b
1 changed files with 22 additions and 25 deletions
47
Rakefile
47
Rakefile
|
@ -1,5 +1,7 @@
|
|||
require 'rubygems'
|
||||
require 'rake'
|
||||
require 'fileutils'
|
||||
require 'pathname'
|
||||
|
||||
begin
|
||||
require 'jeweler'
|
||||
|
@ -14,33 +16,34 @@ begin
|
|||
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
|
||||
system <<-COMMANDS
|
||||
cd ../core &&
|
||||
echo '================================'
|
||||
echo 'Running spec/core suite . . .'
|
||||
echo '================================'
|
||||
rake &&
|
||||
cd ../mocks &&
|
||||
echo '================================'
|
||||
echo 'Running spec/mocks suite . . .'
|
||||
echo '================================'
|
||||
rake &&
|
||||
cd ../expectations &&
|
||||
echo '================================'
|
||||
echo 'Running spec/expectations suite . . .'
|
||||
echo '================================'
|
||||
rake
|
||||
COMMANDS
|
||||
arbitrary_command('rake')
|
||||
end
|
||||
|
||||
task :default => :spec
|
||||
|
@ -50,13 +53,7 @@ namespace :git do
|
|||
command = key == :reset ? "reset --hard" : key.to_s
|
||||
desc "git #{command} on all the repos"
|
||||
task key do
|
||||
["../meta","../core","../expectations", "../mocks"].each do |repo|
|
||||
puts
|
||||
puts "=" * 50
|
||||
puts "running git #{command} on #{repo}:"
|
||||
puts "=" * 50
|
||||
puts `cd #{repo} && git #{command}`
|
||||
end
|
||||
arbitrary_command("git #{command}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue