Skip to content
Browse files

WIP: use bundler and appraisal

  • Loading branch information...
1 parent 702d365 commit e94940655a1f4d2513a7dbd9073e0623d5d2957e Harold Giménez committed Jan 12, 2011
Showing with 89 additions and 7 deletions.
  1. +3 −0 .gitignore
  2. +7 −0 Appraisal
  3. +12 −0 Gemfile
  4. +60 −0 Gemfile.lock
  5. +5 −0 Rakefile
  6. +2 −7 features/step_definitions/rails_application_steps.rb
View
3 .gitignore
@@ -12,3 +12,6 @@ tags
doc
pkg
*.gemspec
+*.gem
+.bundle
+pkg/*
View
7 Appraisal
@@ -0,0 +1,7 @@
+RAILS_VERSIONS = IO.read('SUPPORTED_RAILS_VERSIONS').strip.split("\n")
+
+RAILS_VERSIONS.each do |version|
+ appraise version do
+ gem rails version
+ end
+end
View
12 Gemfile
@@ -0,0 +1,12 @@
+source :rubygems
+
+gem "builder"
+gem "activesupport"
+gem "rspec", "1.3.1"
+gem "fakeweb"
+gem "cucumber", "0.10.0"
+gem "rails", "2.3.8"
+gem "bourne"
+gem "nokogiri", "1.4.3.1"
+gem "shoulda", "2.11.3"
+gem "appraisal"
View
60 Gemfile.lock
@@ -0,0 +1,60 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.8)
+ actionpack (= 2.3.8)
+ actionpack (2.3.8)
+ activesupport (= 2.3.8)
+ rack (~> 1.1.0)
+ activerecord (2.3.8)
+ activesupport (= 2.3.8)
+ activeresource (2.3.8)
+ activesupport (= 2.3.8)
+ activesupport (2.3.8)
+ appraisal (0.1)
+ bundler
+ rake
+ bourne (1.0)
+ mocha (= 0.9.8)
+ builder (3.0.0)
+ cucumber (0.10.0)
+ builder (>= 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ diff-lcs (1.1.2)
+ fakeweb (1.3.0)
+ gherkin (2.3.3)
+ json (~> 1.4.6)
+ json (1.4.6)
+ mocha (0.9.8)
+ rake
+ nokogiri (1.4.3.1)
+ rack (1.1.0)
+ rails (2.3.8)
+ actionmailer (= 2.3.8)
+ actionpack (= 2.3.8)
+ activerecord (= 2.3.8)
+ activeresource (= 2.3.8)
+ activesupport (= 2.3.8)
+ rake (>= 0.8.3)
+ rake (0.8.7)
+ rspec (1.3.1)
+ shoulda (2.11.3)
+ term-ansicolor (1.0.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activesupport
+ appraisal
+ bourne
+ builder
+ cucumber (= 0.10.0)
+ fakeweb
+ nokogiri (= 1.4.3.1)
+ rails (= 2.3.8)
+ rspec (= 1.3.1)
+ shoulda (= 2.11.3)
View
5 Rakefile
@@ -1,8 +1,13 @@
+require 'rubygems'
+require 'bundler'
+require 'bundler/setup'
+require 'appraisal'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'cucumber/rake/task'
+Bundler::GemHelper.install_tasks
desc 'Default: run unit tests.'
task :default => [:test, "cucumber:rails:all"]
View
9 features/step_definitions/rails_application_steps.rb
@@ -5,20 +5,15 @@
@terminal.cd(TEMP_DIR)
version_string = ENV['RAILS_VERSION']
- rails3 = version_string =~ /^3/
+ rails3 = (Rails::VERSION::MAJOR == '3')
if rails3
rails_create_command = 'new'
else
rails_create_command = ''
end
- load_rails = <<-RUBY
- gem 'rails', '#{version_string}'; \
- load Gem.bin_path('rails', 'rails', '#{version_string}')
- RUBY
-
- @terminal.run(%{ruby -rubygems -e "#{load_rails.strip!}" #{rails_create_command} rails_root})
+ @terminal.run(%{rails #{rails_create_command} rails_root})
if rails_root_exists?
@terminal.echo("Generated a Rails #{version_string} application")
else

0 comments on commit e949406

Please sign in to comment.
Something went wrong with that request. Please try again.