2012-07-06 04:00:34 -04:00
|
|
|
require "rubygems"
|
|
|
|
require "bundler/setup"
|
2011-08-27 05:36:18 -04:00
|
|
|
require "bundler/gem_tasks"
|
2012-07-06 04:00:34 -04:00
|
|
|
require "appraisal"
|
|
|
|
|
|
|
|
desc 'Create test Rails app'
|
|
|
|
task :init_test_app do
|
|
|
|
`rm -rf test/app >/dev/null 2>&1`
|
|
|
|
`env BUNDLE_GEMFILE=gemfiles/rails30.gemfile bundle exec rails new test/app`
|
2012-07-13 16:20:37 -04:00
|
|
|
FileUtils.cp("test/routes.rb", "test/app/config/routes.rb")
|
2012-07-13 18:20:48 -04:00
|
|
|
File.open("test/app/Gemfile", 'a+') { |f| f.write(%Q{gem "pry-rails", :path => "../../"}) }
|
2012-07-16 01:15:12 -04:00
|
|
|
FileUtils.cd("test/app")
|
|
|
|
`env BUNDLE_GEMFILE=../../gemfiles/rails30.gemfile bundle exec rails g model Pokemon name:string caught:binary species:string abilities:string`
|
|
|
|
`env BUNDLE_GEMFILE=../../gemfiles/rails30.gemfile bundle exec rails g model Hacker social_ability:integer`
|
|
|
|
`env BUNDLE_GEMFILE=../../gemfiles/rails30.gemfile bundle exec rails g model Beer name:string type:string rating:integer ibu:integer abv:integer`
|
2012-07-06 04:00:34 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Start the Rails server'
|
|
|
|
task :server do
|
|
|
|
exec 'cd test/app && rails server'
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Start the Rails console'
|
|
|
|
task :console do
|
|
|
|
exec 'cd test/app && rails console'
|
|
|
|
end
|