Rakefile in cogy-0.5.2 vs Rakefile in cogy-0.6.0
- old
+ new
@@ -2,10 +2,14 @@
require "bundler/setup"
rescue LoadError
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end
-APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+gemfile_name = File.basename(ENV["BUNDLE_GEMFILE"], ".gemfile")
+rails_version = gemfile_name == "Gemfile" ? "5.1" : gemfile_name
+ENV["COGY_DUMMY_APP_PATH"] = File.expand_path("../test/dummies/#{rails_version}", __FILE__)
+
+APP_RAKEFILE = "#{ENV['COGY_DUMMY_APP_PATH']}/Rakefile".freeze
load "rails/tasks/engine.rake"
load "rails/tasks/statistics.rake"
Bundler::GemHelper.install_tasks