Skip to content
Browse files

add docs to rake tasks, use gemfiles correctly if run through bundler

  • Loading branch information...
1 parent e5701f3 commit b9cc729754609540eb309bea1aeff576555e8f0a @lest lest committed Aug 21, 2012
Showing with 10 additions and 0 deletions.
  1. +3 −0 README.md
  2. +7 −0 Rakefile
View
3 README.md
@@ -148,9 +148,12 @@ If you have any issues with Nested Form not addressed above or in the [example p
```
bundle install
bundle exec rake spec:install
+bundle exec rake db:migrate
bundle exec rake spec:all
```
+See available rake tasks using `bundle exec rake -T`.
+
## Special Thanks
This gem was originally based on the solution by Tim Riley in his [complex-form-examples fork](https://github.com/timriley/complex-form-examples/tree/unobtrusive-jquery-deep-fix2).
View
7 Rakefile
@@ -14,26 +14,33 @@ end
task :default => :spec
namespace :db do
+ desc 'Prepare sqlite database'
task :migrate do
system 'cd spec/dummy && rake db:migrate RAILS_ENV=test && rake db:migrate RAILS_ENV=development'
end
end
namespace :spec do
+ desc 'Install gems from additional gemfiles'
task :install do
system 'bundle install'
+ ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_1', __FILE__)
system 'bundle install'
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_0', __FILE__)
system 'bundle install'
end
+ desc 'Run tests with Rails 3.1.x'
task :rails3_1 do
+ ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_1', __FILE__)
Rake::Task["spec"].execute
end
+ desc 'Run tests with Rails 3.0.x'
task :rails3_0 do
+ ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_0', __FILE__)
Rake::Task["spec"].execute
end

0 comments on commit b9cc729

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