engine_cart 0.8.2 → 0.9.1

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: f28b9c3f6915fc494c0dda7bfe3139d75dd716f1
4
+ data.tar.gz: ca16aac3634c2f2c30027d642e382424768481f9
5
5
  SHA512:
6
- metadata.gz: 19a1cf6d4787639f2b0b47ecfb1ff8c64c63c76e690ea3bfecff32025e9c951befd50a82bde24d70d360a355765f6a0076aef2a89d5ee0fdd7f401e0cb978763
7
- data.tar.gz: 842f1c6f32a57188b0acb8c00b36eb726ed79826a6997dd5acaa0ab99a220a1417242d9c71d2683d0bfdee64f16be2257d53bd0e171174105617b497023b5269
6
+ metadata.gz: 7e7b45bb1d0c0aca7730068d05fbb4641c8966414d83ae2ae5d02c128048892bcb6f0754e28485bbd5223237603f3254be114fd36c69b7f70e67267feb57839f
7
+ data.tar.gz: d0dc6729dff7a666a29c3c7b6fcdd547df12efaf8abb883003efa2047433ea2455666c769a30b4093664e4b3bafdfb73abe2cd51be028ac12286eb69bdb028f4
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
 
@@ -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.9.1'
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.9.1
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-05 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: