diff --git a/.gitignore b/.gitignore index 3a4f2b5..990a71a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ tmp coverage pkg .bundle +.internal_test_app diff --git a/Gemfile b/Gemfile index 5765daf..77e39c4 100644 --- a/Gemfile +++ b/Gemfile @@ -8,17 +8,28 @@ gemspec # Git. Remember to move these dependencies to your gemspec before releasing # your gem to rubygems.org. -# load local rails test instance Gemfile (engine cart adds this automagically) -file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__)) -if File.exists?(file) - puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` - instance_eval File.read(file) +# BEGIN ENGINE_CART BLOCK +# engine_cart: 0.8.0 +# engine_cart stanza: 0.8.0 +# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app. +file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__))) +if File.exist?(file) + begin + eval_gemfile file + rescue Bundler::GemfileError => e + Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:' + Bundler.ui.warn e.message + end else - gem 'rails', ENV['RAILS_VERSION'] - # explicitly include sass-rails to get compatible sprocket dependencies - if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/ - gem 'sass-rails', ">= 5.0.0.beta1" + Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies" + + gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION'] + + if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/ + gem 'responders', "~> 2.0" + gem 'sass-rails', ">= 5.0" else gem 'sass-rails', "< 5.0" end end +# END ENGINE_CART BLOCK \ No newline at end of file diff --git a/blacklight-hierarchy.gemspec b/blacklight-hierarchy.gemspec index f2dedb3..3d333c4 100644 --- a/blacklight-hierarchy.gemspec +++ b/blacklight-hierarchy.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.add_development_dependency "rspec-rails" s.add_development_dependency "sqlite3" - s.add_development_dependency "engine_cart" + s.add_development_dependency "engine_cart", '~> 0.8' s.add_development_dependency "capybara" s.add_development_dependency "coveralls" end diff --git a/lib/blacklight/hierarchy/engine.rb b/lib/blacklight/hierarchy/engine.rb index 16d444a..abbb486 100644 --- a/lib/blacklight/hierarchy/engine.rb +++ b/lib/blacklight/hierarchy/engine.rb @@ -1,8 +1,9 @@ require 'blacklight' +require 'rails' module Blacklight module Hierarchy class Engine < Rails::Engine end end -end \ No newline at end of file +end