Gemfiles for testing and a rails test helper that works for both rails 2 and rails 3.

This commit is contained in:
Chris Eppstein 2010-08-28 13:58:08 -07:00
parent a2a9835688
commit 13055f4731
4 changed files with 29 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
*.DS_Store
*.tmproj
*.lock
sync
tmp/*
examples/*/stylesheets/*

8
Gemfile Normal file
View File

@ -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"

8
Gemfile_rails2 Normal file
View File

@ -0,0 +1,8 @@
source :rubygems
gem "compass", :path => "."
gem "cucumber"
gem "rspec"
gem "rails", "~>2.3"
gem "compass-validator"
gem "css_parser"

View File

@ -19,13 +19,18 @@ module Compass
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)