Rakefile in formtastic-3.1.5 vs Rakefile in formtastic-4.0.0.rc1

- old
+ new

@@ -1,17 +1,36 @@ # encoding: utf-8 require 'bundler/setup' -require 'appraisal' require 'yard' require 'rspec/core/rake_task' Bundler::GemHelper.install_tasks desc 'Default: run unit specs.' if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"] task :default => :appraisal else task :default => :spec +end + +desc 'Run the default task over all gemfiles.' +task :appraisal do + for_all_gemfiles("exec", "rake") +end + +namespace :appraisal do + desc 'Run `bundle install` over all gemfiles.' + task :install do + for_all_gemfiles("install") + end +end + +def for_all_gemfiles(*args) + Dir.glob("gemfiles/*/Gemfile").sort.each do |gemfile| + Bundler.with_original_env do + sh({ "APPRAISAL_INITIALIZED" => "true", "BUNDLE_GEMFILE" => gemfile }, "bundle", *args) + end + end end desc 'Generate documentation for the formtastic plugin.' YARD::Rake::YardocTask.new(:yard) do |t|