Skip to content

Commit

Permalink
Initial Rake tasks for dev environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
spicycode committed Nov 6, 2009
1 parent 90b0116 commit 0910111
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.sw?
.DS_Store
coverage
rdoc
pkg
repos
67 changes: 67 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
require 'rubygems'
require 'rake'
require 'fileutils'
require 'pathname'

def run_command(command)
['meta', 'core', 'expectations', 'mocks'].each do |dir|
FileUtils.cd(ReposPath) do
puts "====================================="
puts "Running [#{command}] in #{ReposPath.join(dir)}"
puts "====================================="
FileUtils.cd(ReposPath.join(dir)) do
system command
end
puts
end
end
end

task :clobber do
rm_rf 'pkg'
end

task :spec do
run_command 'rake'
end

task :default => :spec


BaseRspecPath = Pathname.new(Dir.pwd)
ReposPath = BaseRspecPath.join('repos')

def make_repos_directory
end

task :make_repos_directory do
FileUtils.mkdir_p ReposPath
end

namespace :git do

{ :status => nil,
:pull => '--rebase',
:push => nil,
:reset => '--hard',
:diff => nil
}.each do |command, options|
desc "git #{command} on all the repos"
task command => :clone do
run_command "git #{command} #{options}".strip
end
end

task :st => :status

desc "git clone all the repos the first time"
task :clone => :make_repos_directory do
FileUtils.cd(ReposPath) do
['core', 'expectations', 'mocks', 'meta'].each do |repo|
unless File.exists?(repo)
system "git clone git://github.com/rspec/#{repo}.git"
end
end
end
end
end

0 comments on commit 0910111

Please sign in to comment.