engine_cart 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c04d95e36edb84b7dea3b5681a416df82d6505a
4
- data.tar.gz: 7bbbf882051a2d7286add6d53a7988a61a74e6db
3
+ metadata.gz: 8d338f4c1822f3975c981752fe0e7ef0fb417f54
4
+ data.tar.gz: d7ca112daff894c79df45a376e804919b79b45f7
5
5
  SHA512:
6
- metadata.gz: 19a1cf6d4787639f2b0b47ecfb1ff8c64c63c76e690ea3bfecff32025e9c951befd50a82bde24d70d360a355765f6a0076aef2a89d5ee0fdd7f401e0cb978763
7
- data.tar.gz: 842f1c6f32a57188b0acb8c00b36eb726ed79826a6997dd5acaa0ab99a220a1417242d9c71d2683d0bfdee64f16be2257d53bd0e171174105617b497023b5269
6
+ metadata.gz: cbf59d6d25f6f34f76d83a3e9495c03d5ac7a0dd3812d8dafa804e82f350a7a198f87a40d0d69ea387fed75c282864a8da73cdda754b2c754f19d12565c53be8
7
+ data.tar.gz: 2504e8bd319a7e6c9d239776d7b3e844ec887b6d4af0ac29cc96ef4d8ae54a30a0098f3eba6b91e2f686e297f865c2b7b2a04eeffb5a5614520a340377bc0fb0
data/.travis.yml CHANGED
@@ -1,9 +1,14 @@
1
1
  language: ruby
2
2
  sudo: false
3
3
  rvm:
4
- - 2.3.0
4
+ - 2.3.1
5
5
 
6
6
  matrix:
7
7
  include:
8
- - rvm: '2.2.4'
9
- env: "RAILS_VERSION=4.1.14"
8
+ - rvm: '2.2.5'
9
+ env: "RAILS_VERSION=4.1.15"
10
+ - rvm: '2.2.5'
11
+ env: "RAILS_VERSION=4.2.6"
12
+
13
+ env:
14
+ - "RAILS_VERSION=5.0.0"
data/Gemfile CHANGED
@@ -4,5 +4,8 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
7
- gem 'sass', '~> 3.2.15'
8
- gem 'sprockets', '~> 2.11.0'
7
+
8
+ if ENV['RAILS_VERSION'] && ENV['RAILS_VERSION'] < '4.2'
9
+ gem 'sass', '~> 3.2.15'
10
+ gem 'sprockets', '~> 2.11.0'
11
+ end
data/README.md CHANGED
@@ -48,7 +48,7 @@ In order for your Rails engine gem to use engine_cart, some configuration is req
48
48
  $ rake engine_cart:prepare
49
49
  ```
50
50
 
51
- This will create `lib/generators/test_app_generator.rb` in your engine and it will also append some code to your engine's `Gemfile`.
51
+ This will create `./spec/test_app_templates/lib/generators` in your engine and it will also append some code to your engine's `Gemfile`.
52
52
 
53
53
  You only need to run this rake task once.
54
54
 
data/Rakefile CHANGED
@@ -45,8 +45,10 @@ task :generate_test_gem => ['engine_cart:setup'] do
45
45
  end
46
46
 
47
47
  system "echo '\ngem \"rspec-rails\"\n' >> Gemfile"
48
- system %Q{echo '\ngem "sass", "~> 3.2.15"\n' >> Gemfile}
49
- system %Q{echo '\ngem "sprockets", "~> 2.11.0"\n' >> Gemfile}
48
+ if Gem.loaded_specs["rails"].version.to_s < '4.2'
49
+ system %Q{echo '\ngem "sass", "~> 3.2.15"\n' >> Gemfile}
50
+ system %Q{echo '\ngem "sprockets", "~> 2.11.0"\n' >> Gemfile}
51
+ end
50
52
  Bundler.clean_system "bundle update --quiet"
51
53
  system "echo 'require \"engine_cart/rake_task\"\n' >> Rakefile"
52
54
 
@@ -2,7 +2,7 @@ require 'engine_cart/params'
2
2
 
3
3
  module EngineCart
4
4
  def self.gemfile_stanza_check_line
5
- "engine_cart stanza: 0.8.0"
5
+ "engine_cart stanza: 0.10.0"
6
6
  end
7
7
 
8
8
  def self.gemfile_stanza_text
@@ -11,7 +11,7 @@ module EngineCart
11
11
  # engine_cart: #{EngineCart::VERSION}
12
12
  # #{EngineCart.gemfile_stanza_check_line}
13
13
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
14
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("#{EngineCart.destination}", File.dirname(__FILE__)))
14
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('#{EngineCart.destination}', File.dirname(__FILE__)))
15
15
  if File.exist?(file)
16
16
  begin
17
17
  eval_gemfile file
@@ -25,19 +25,19 @@ module EngineCart
25
25
  if ENV['RAILS_VERSION']
26
26
  if ENV['RAILS_VERSION'] == 'edge'
27
27
  gem 'rails', github: 'rails/rails'
28
- ENV['ENGINE_CART_RAILS_OPTIONS']= "--edge --skip-turbolinks"
28
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
29
29
  else
30
30
  gem 'rails', ENV['RAILS_VERSION']
31
31
  end
32
32
  end
33
33
 
34
- if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4\.2/
35
- gem 'responders', "~> 2.0"
36
- gem 'sass-rails', ">= 5.0"
37
- elsif ENV['RAILS_VERSION'] =~ /^5\.0/ || ENV['RAILS_VERSION'] == 'edge'
38
- # nop
39
- else
40
- gem 'sass-rails', "< 5.0"
34
+ case ENV['RAILS_VERSION']
35
+ when /^4\.2/
36
+ gem 'responders', '~> 2.0'
37
+ gem 'sass-rails', '>= 5.0'
38
+ gem 'coffee-rails', '~> 4.1.0'
39
+ when /^4\.[01]/
40
+ gem 'sass-rails', '< 5.0'
41
41
  end
42
42
  end
43
43
  # END ENGINE_CART BLOCK
@@ -28,19 +28,23 @@ namespace :engine_cart do
28
28
  require 'tmpdir'
29
29
  require 'fileutils'
30
30
  Dir.mktmpdir do |dir|
31
- Dir.chdir dir do
32
- version = ENV.fetch('RAILS_VERSION', ">= 0")
33
- rails_path = Gem.bin_path('railties', 'rails', version)
34
-
35
- Bundler.with_clean_env do
36
- `#{rails_path} new internal --skip-spring #{EngineCart.rails_options} #{"-m #{EngineCart.template}" if EngineCart.template}`
37
- end
38
-
39
- unless $?
40
- raise "Error generating new rails app. Aborting."
31
+ # Fork into a new process to avoid polluting the current one with the partial Rails environment ...
32
+ pid = fork do
33
+ Dir.chdir dir do
34
+ require 'rails/generators'
35
+ require 'rails/generators/rails/app/app_generator'
36
+
37
+ # Using the Rails generator directly, instead of shelling out, to
38
+ # ensure we use the right version of Rails.
39
+ Rails::Generators::AppGenerator.start(['internal', '--skip_spring', EngineCart.rails_options, ("-m #{EngineCart.template}" if EngineCart.template)].compact)
41
40
  end
41
+ exit 0
42
42
  end
43
43
 
44
+ # ... and then wait for it to catch up.
45
+ _, status = Process.waitpid2 pid
46
+ exit status.exitstatus unless status.success?
47
+
44
48
  Rake::Task['engine_cart:clean'].invoke if File.exist? EngineCart.destination
45
49
  FileUtils.move "#{dir}/internal", "#{EngineCart.destination}"
46
50
 
@@ -122,9 +126,11 @@ namespace :engine_cart do
122
126
  end
123
127
 
124
128
  def within_test_app
129
+ puts "travis_fold:start:enginecart-bundler-cleanenv\r" if ENV['TRAVIS'] == 'true'
125
130
  Dir.chdir(EngineCart.destination) do
126
131
  Bundler.with_clean_env do
127
132
  yield
128
133
  end
129
134
  end
135
+ puts "travis_fold:end:enginecart-bundler-cleanenv\r" if ENV['TRAVIS'] == 'true'
130
136
  end
@@ -1,3 +1,3 @@
1
1
  module EngineCart
2
- VERSION = '0.8.2'
2
+ VERSION = '0.10.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engine_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-07 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -110,11 +110,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.4.5.1
113
+ rubygems_version: 2.6.4
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Helper for testing Rails Engines sanely
117
117
  test_files:
118
118
  - spec/integration/engine_cart_spec.rb
119
119
  - spec/spec_helper.rb
120
- has_rdoc: