Skip to content

Commit

Permalink
let bundler manage rails from github
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 22, 2010
1 parent f8b5560 commit cf10d0c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 45 deletions.
6 changes: 4 additions & 2 deletions Gemfile
@@ -1,11 +1,13 @@
source "http://rubygems.org"

gem 'arel', :path => "./vendor/arel"
gem 'rails', :path => "./vendor/rails"
gem 'arel', :git => "git://github.com/rails/arel.git"
gem 'rails', :git => "git://github.com/rails/rails.git"

gem 'rspec-core', :path => "../rspec-core"
gem 'rspec-expectations', :path => "../rspec-expectations"
gem 'rspec-mocks', :path => "../rspec-mocks"
gem 'rspec', :path => "../rspec"

gem 'thor'
gem 'cucumber'
gem 'aruba'
Expand Down
38 changes: 2 additions & 36 deletions Rakefile
Expand Up @@ -57,45 +57,11 @@ namespace :gem do
end
end

namespace :rails do
desc "clone the rails repo"
task :clone do
mkdir 'vendor' unless File.directory?('vendor')
install_bundle = false
unless File.directory?('vendor/arel')
install_bundle = true
Dir.chdir('vendor') do
sh "git clone git://github.com/rails/arel"
end
end
unless File.directory?('vendor/rails')
install_bundle = true
Dir.chdir('vendor') do
sh "git clone git://github.com/rails/rails"
end
end
sh "bundle install" if install_bundle
end

desc "update the rails repo"
task :update => :clone do
Dir.chdir('vendor/arel') do
sh "git checkout master"
sh "git pull"
end
Dir.chdir('vendor/rails') do
sh "git checkout master"
sh "git pull"
end
sh "bundle install"
end
end

namespace :generate do
desc "generate a fresh app with rspec installed"
task :app => ["rails:clone"] do |t|
task :app do |t|
unless File.directory?('./tmp/example_app')
sh "bundle exec ./vendor/rails/bin/rails new ./tmp/example_app"
sh "bundle exec rails new ./tmp/example_app"
sh "cp ./templates/Gemfile ./tmp/example_app/"
end
end
Expand Down
12 changes: 6 additions & 6 deletions templates/Gemfile
@@ -1,12 +1,12 @@
source 'http://rubygems.org'

gem "arel", :path => "../../vendor/arel"
gem "rails", :path => "../../vendor/rails"
gem 'arel', :git => "git://github.com/rails/arel.git"
gem 'rails', :git => "git://github.com/rails/rails.git"

gem 'sqlite3-ruby', :require => 'sqlite3'

gem "rspec", :path => "../../../rspec"
gem "rspec-core", :path => "../../../rspec-core"
gem "rspec-rails", :path => "../../../rspec-rails"
gem "rspec", :path => "../../../rspec"
gem "rspec-core", :path => "../../../rspec-core"
gem "rspec-expectations", :path => "../../../rspec-expectations"
gem "rspec-mocks", :path => "../../../rspec-mocks"
gem "rspec-rails", :path => "../../../rspec-rails"
gem "rspec-mocks", :path => "../../../rspec-mocks"
2 changes: 1 addition & 1 deletion templates/run_specs.rb
@@ -1,4 +1,4 @@
run('bundle exec ../../../rspec-core/bin/rspec spec -cfdoc')
run('bundle exec rspec spec -cfdoc')
run('rake spec')
run('rake spec:requests')
run('rake spec:models')
Expand Down

0 comments on commit cf10d0c

Please sign in to comment.