Skip to content

Commit

Permalink
Update engine_cart
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Mar 29, 2016
1 parent be1cb0f commit 43627bd
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -17,4 +17,4 @@
Gemfile.lock
coverage
pkg
spec/internal
.internal_test_app
37 changes: 28 additions & 9 deletions Gemfile
Expand Up @@ -2,18 +2,37 @@ source "https://rubygems.org"

gemspec path: File.expand_path('..', __FILE__)

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.2
# 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'] if ENV['RAILS_VERSION']
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"

if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] !~ /^4.2/
gem 'sass-rails', "< 5.0"
else
if ENV['RAILS_VERSION']
if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails'
ENV['ENGINE_CART_RAILS_OPTIONS']= "--edge --skip-turbolinks"
else
gem 'rails', ENV['RAILS_VERSION']
end
end

if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
gem 'responders', "~> 2.0"
gem 'sass-rails', ">= 5.0"
elsif ENV['RAILS_VERSION'] =~ /^5.0/ || ENV['RAILS_VERSION'] == 'edge'
# nop
else
gem 'sass-rails', "< 5.0"
end
end

# END ENGINE_CART BLOCK
2 changes: 1 addition & 1 deletion qa.gemspec
Expand Up @@ -27,6 +27,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rspec-rails"
s.add_development_dependency "webmock"
s.add_development_dependency "simplecov"
s.add_development_dependency "engine_cart"
s.add_development_dependency "engine_cart", '~> 0.8'
s.add_development_dependency "byebug"
end
2 changes: 1 addition & 1 deletion spec/lib/tasks/mesh.rake_spec.rb
Expand Up @@ -6,7 +6,7 @@
before do
@rake = Rake::Application.new
Rake.application = @rake
Rake.application.rake_require "mesh", ["#{Rails.root}/lib/tasks", "#{Rails.root}/../../lib/tasks"], []
Rake.application.rake_require "mesh", ["#{Rails.root}/lib/tasks", "#{Rails.root}/../lib/tasks"], []
Rake::Task.define_task(:environment) # rspec has loaded rails
end

Expand Down
7 changes: 4 additions & 3 deletions spec/spec_helper.rb
@@ -1,6 +1,4 @@
require File.expand_path("../internal/config/environment.rb", __FILE__)
require 'rspec/rails'
require 'webmock/rspec'

require 'engine_cart'
require 'simplecov'
require 'byebug' unless ENV['TRAVIS']
Expand All @@ -11,6 +9,9 @@
SimpleCov.command_name "spec"
EngineCart.load_application!

require 'rspec/rails'
require 'webmock/rspec'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
Expand Down
Expand Up @@ -18,7 +18,7 @@ def run_local_authority_installer
end

def copy_local_authority_fixtures
directory "../fixtures/authorities", "config/authorities"
directory "../spec/fixtures/authorities", "config/authorities"
end

def run_migrations
Expand Down

0 comments on commit 43627bd

Please sign in to comment.