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 *.DS_Store
*.tmproj *.tmproj
*.lock
sync sync
tmp/* tmp/*
examples/*/stylesheets/* 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 end
else else
begin begin
require 'rails/version' require 'action_pack/version'
require 'rails_generator' if ActionPack::VERSION::MAJOR >= 3
require 'rails_generator/scripts/generate' `rails new #{name}`
Rails::Generator::Base.use_application_sources! else
capture_output do require 'rails/version'
Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout require 'rails_generator'
Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app') 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 end
rescue LoadError rescue LoadError
Kernel.exit!(2) Kernel.exit!(2)