Permalink
Browse files

Gemfiles for testing and a rails test helper that works for both rail…

…s 2 and rails 3.
  • Loading branch information...
1 parent a2a9835 commit 13055f473108d2eb40786d52e80439637b0ab3e2 @chriseppstein chriseppstein committed Aug 28, 2010
Showing with 29 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +8 −0 Gemfile
  3. +8 −0 Gemfile_rails2
  4. +12 −7 test/rails_helper.rb
View
@@ -1,5 +1,6 @@
*.DS_Store
*.tmproj
+*.lock
sync
tmp/*
examples/*/stylesheets/*
View
@@ -0,0 +1,8 @@
+source :rubygems
+
+gem "compass", :path => "."
+gem "cucumber"
+gem "rspec"
+gem "rails", "~>3.0.0.rc"
+gem "compass-validator"
+gem "css_parser"
View
@@ -0,0 +1,8 @@
+source :rubygems
+
+gem "compass", :path => "."
+gem "cucumber"
+gem "rspec"
+gem "rails", "~>2.3"
+gem "compass-validator"
+gem "css_parser"
View
@@ -19,13 +19,18 @@ def generate_rails_app(name)
end
else
begin
- require 'rails/version'
- require 'rails_generator'
- require 'rails_generator/scripts/generate'
- Rails::Generator::Base.use_application_sources!
- capture_output do
- Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
- Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
+ require 'action_pack/version'
+ if ActionPack::VERSION::MAJOR >= 3
+ `rails new #{name}`
+ else
+ require 'rails/version'
+ require 'rails_generator'
+ require 'rails_generator/scripts/generate'
+ Rails::Generator::Base.use_application_sources!
+ capture_output do
+ Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout
+ Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app')
+ end
end
rescue LoadError
Kernel.exit!(2)

0 comments on commit 13055f4

Please sign in to comment.