Permalink
Browse files

separate Gemfiles for different versions of rails

  • Loading branch information...
dchelimsky committed Jan 25, 2011
1 parent e01608a commit 25407a80677f8eb91eb7123129be38759407b1c9
Showing with 53 additions and 31 deletions.
  1. +1 −0 .gitignore
  2. +6 −0 Gemfile-3-0-stable
  3. +3 −0 Gemfile-3.0.0
  4. +3 −0 Gemfile-3.0.3
  5. +3 −9 Gemfile → Gemfile-base
  6. +5 −0 Gemfile-master
  7. +9 −7 Rakefile
  8. +6 −0 Thorfile
  9. +0 −15 templates/Gemfile
  10. +17 −0 templates/Gemfile-base
View
@@ -6,3 +6,4 @@ doc
vendor
.bundle
Gemfile.lock
+Gemfile
View
@@ -0,0 +1,6 @@
+instance_eval(File.read("./Gemfile-base"))
+
+gem "rails", :git => "https://github.com/rails/rails.git", :branch => "3-0-stable"
+gem "arel", :git => "https://github.com/rails/arel.git"
+gem "rack", :git => "git://github.com/rack/rack.git"
+
View
@@ -0,0 +1,3 @@
+instance_eval(File.read("./Gemfile-base"))
+
+gem "rails", "3.0.0"
View
@@ -0,0 +1,3 @@
+instance_eval(File.read("./Gemfile-base"))
+
+gem "rails", "3.0.3"
View
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-%w[rspec rspec-core rspec-expectations rspec-mocks].each do |lib|
+%w[rspec rspec-core rspec-expectations rspec-mocks rspec-rails].each do |lib|
library_path = File.expand_path("../../#{lib}", __FILE__)
if File.exist?(library_path)
gem lib, :path => library_path
@@ -9,8 +9,7 @@ source "http://rubygems.org"
end
end
-gem "arel", :path => "~/projects/ruby/arel"
-
+gem 'sqlite3-ruby', :require => 'sqlite3'
gem "rake", "0.8.7"
gem "cucumber", "0.10.0"
gem "aruba", "0.2.2"
@@ -19,6 +18,7 @@ gem "relish", "0.2.0"
gem "guard-rspec", "0.1.9"
gem "growl", "1.0.3"
gem "ZenTest", "~> 4.4.2"
+gem "webrat", "0.7.2"
if RUBY_PLATFORM =~ /darwin/
gem "autotest-fsevent", "~> 0.2.4"
@@ -36,9 +36,3 @@ end
platforms :jruby do
gem "jruby-openssl"
end
-
-#### rspec-rails only
-gem "rails", :path => File.expand_path("../vendor/rails", __FILE__)
-gem "rack", :git => "git://github.com/rack/rack.git"
-gem 'webrat', "0.7.2"
-gem 'sqlite3-ruby', :require => 'sqlite3'
View
@@ -0,0 +1,5 @@
+instance_eval(File.read("./Gemfile-base"))
+
+gem "rails", :git => "https://github.com/rails/rails.git"
+gem "arel", :git => "https://github.com/rails/arel.git"
+gem "rack", :git => "https://github.com/rack/rack.git"
View
@@ -1,10 +1,12 @@
-unless File.directory?("vendor/rails")
+unless File.exist?('./Gemfile')
raise <<-MESSAGE
-You need to clone the rails git repository into ./vendor before you can use any
-of the rake tasks.
-
- git clone git://github.com/rails/rails.git vendor/rails
+Could not find a Gemfile. Please run any of:
+ thor rails:use 3-0-stable
+ thor rails:use master
+ thor rails:use 3.0.0
+ thor rails:use 3.0.3
+And then run 'bundle install'
MESSAGE
end
require "bundler"
@@ -54,8 +56,8 @@ namespace :generate do
task :app do |t|
unless File.directory?('./tmp/example_app')
sh "bundle exec rails new ./tmp/example_app"
- sh "cp ./templates/Gemfile ./tmp/example_app/"
- sh "cp ./specs.watchr ./tmp/example_app/"
+ sh "cp ./templates/Gemfile-base ./tmp/example_app/"
+ sh "cp ./Gemfile ./tmp/example_app/"
end
end
View
@@ -15,4 +15,10 @@ class Rails < Thor
`git fetch`
end
end
+
+ desc "use VERSION", "copies the appropriate Gemfile to Gemfile"
+ def use(version)
+ `cp ./Gemfile-#{version} ./Gemfile`
+ `rm ./Gemfile.lock`
+ end
end
View
@@ -1,15 +0,0 @@
-source 'http://rubygems.org'
-
-gem "rack", :git => "git://github.com/rack/rack.git"
-gem 'rails', :path => File.expand_path("../../../vendor/rails", __FILE__)
-gem 'sqlite3-ruby', :require => 'sqlite3'
-
-group :development, :test do
- %w[rspec rspec-core rspec-expectations rspec-mocks rspec-rails].each do |lib|
- gem lib, :path => File.expand_path("../../../../#{lib}", __FILE__)
- end
- gem "rcov"
- gem "webrat"
- gem "autotest"
- gem "watchr"
-end
View
@@ -0,0 +1,17 @@
+source 'http://rubygems.org'
+
+group :development, :test do
+ %w[rspec rspec-core rspec-expectations rspec-mocks rspec-rails].each do |lib|
+ library_path = File.expand_path("../../../../#{lib}", __FILE__)
+ if File.exist?(library_path)
+ gem lib, :path => library_path
+ else
+ gem lib
+ end
+ end
+ gem "rcov"
+ gem "webrat", "0.7.2"
+ gem "ZenTest", "4.4.2"
+end
+
+gem 'sqlite3-ruby', :require => 'sqlite3'

0 comments on commit 25407a8

Please sign in to comment.