engine_cart 2.6.0 → 2.7.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
  SHA256:
3
- metadata.gz: 864ca4cc0c524ad80281f92e1dce77df32cb2a2c4b6f27d293721ee8e9305412
4
- data.tar.gz: 5c8ec70e88e2a6efd9d919c04c56be20509afebacce106118d3061de56a40cfc
3
+ metadata.gz: 0c9c862d77d839d24bac91c4e8f6d18cd8c031eaf39d5330c718bd4896a6cf3c
4
+ data.tar.gz: 9afabca37a2c8c13ef48dfcff60161540ff587f840706517e02cadf81b544376
5
5
  SHA512:
6
- metadata.gz: 324a7c844887c7f43923d6d8dadd72f599567158ad6bd8876496865700239be2a28a0314feef816e7ce2b8cb5dff405b4d6bc3ec93d8912ac8e7bb13554e56b1
7
- data.tar.gz: f377f63b4585553142802de3451eaaa4882de55bd821976e45c892e820d43bb708ef9c6afba7d166a883d8150be6d03bfdaec62aa93614d9a21ce521eb8e7d10
6
+ metadata.gz: ff2e7b28c8c29428f7ee533bbf2af5fe6d1c58a084d4b542334cfc91a3726e88603cdcd5595f5ba9bd2dbfdb0e44abda6b6450ccca851e06e9677cc0c70fd324
7
+ data.tar.gz: 4f246cecdbc1255e428b11cd6ad4b612c9d670e74b48288fe3ab1eb24d690c3c027bd217d9246c4bcb6fd69aa32907bb657b1926329c6041c7fa6bcea63a47e2
@@ -2,9 +2,9 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [master]
6
6
  pull_request:
7
- branches: [ master ]
7
+ branches: [master]
8
8
 
9
9
  jobs:
10
10
  test:
@@ -12,31 +12,25 @@ jobs:
12
12
  strategy:
13
13
  matrix:
14
14
  ruby:
15
- - 3.1
15
+ - 3.2
16
+ - 3.4
17
+ - '4.0'
16
18
  rails_version:
17
- - 6.1.6.1
18
- - 7.0.3.1
19
- include:
20
- - ruby: '2.7.8' # Rails 6.0 will not run on Ruby 3
21
- rails_version: '6.0.5.1'
22
- - ruby: '2.7.8' # Rails 5.2 will not run on Ruby 3
23
- rails_version: '5.2.8.1'
24
- - ruby: '3.2.2'
25
- rails_version: '7.1.1'
26
- - ruby: '3.3.0'
27
- rails_version: '7.1.1'
19
+ - 7.2.3
20
+ - 8.0.4
21
+ - 8.1.1
28
22
  steps:
29
- - uses: actions/checkout@v2
30
- - name: Set up Ruby
31
- uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- bundler: 'latest'
35
- - name: Install dependencies
36
- run: bundle install
37
- env:
38
- RAILS_VERSION: ${{ matrix.rails_version }}
39
- - name: Run tests
40
- run: bundle exec rake
41
- env:
42
- RAILS_VERSION: ${{ matrix.rails_version }}
23
+ - uses: actions/checkout@v2
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ bundler: "latest"
29
+ - name: Install dependencies
30
+ run: bundle install
31
+ env:
32
+ RAILS_VERSION: ${{ matrix.rails_version }}
33
+ - name: Run tests
34
+ run: bundle exec rake
35
+ env:
36
+ RAILS_VERSION: ${{ matrix.rails_version }}
data/Gemfile CHANGED
@@ -4,13 +4,3 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
7
-
8
- case ENV['RAILS_VERSION']
9
- when /^6.0/
10
- gem 'sass-rails', '>= 6'
11
- gem 'webpacker', '~> 4.0'
12
- when /^5.[12]/
13
- gem 'sprockets', '< 4.0'
14
- gem 'sass-rails', '~> 5.0'
15
- gem 'thor', '~> 0.20'
16
- end
data/README.md CHANGED
@@ -7,7 +7,7 @@ Rake tasks to generate a test application for a Rails Engine gem.
7
7
  If you have a Rails Engine and want to test it, the suggested approach is a small dummy application that loads up a Rails application with your engine loaded. This dummy application is usually checked into source control and maintained with the application. This works great, until you want to test:
8
8
 
9
9
  - different versions of Ruby (e.g. MRI and JRuby)
10
- - different versions of Rails (Rails 5.0, 6.0)
10
+ - different versions of Rails (Rails 6.1, 7.1)
11
11
  - different deployment environments (with and without devise, etc)
12
12
 
13
13
  where each scenario may involve different configurations, Gemfiles, etc.
data/Rakefile CHANGED
@@ -35,7 +35,7 @@ task :generate_test_gem => ['engine_cart:setup'] do
35
35
  end
36
36
 
37
37
  IO.write(".internal_test_gem/internal_test_gem.gemspec", gemspec_data)
38
- IO.write(".internal_test_gem/Gemfile", File.open(".internal_test_gem/Gemfile") {|f| f.read.gsub(/.*sqlite3.*/, "")})
38
+ IO.write(".internal_test_gem/Gemfile", File.open(".internal_test_gem/Gemfile") {|f| f.read.gsub(/.*sqlite3.*/, "").gsub(/.*puma.*/, "")})
39
39
 
40
40
  Rake::Task['engine_cart:inject_gemfile_extras'].invoke
41
41
  EngineCart.within_test_app do
@@ -56,6 +56,18 @@ task :generate_test_gem => ['engine_cart:setup'] do
56
56
  EOF
57
57
  end
58
58
 
59
+ FileUtils.mkdir_p('lib/generators/internal_test_gem')
60
+ File.open('lib/generators/internal_test_gem/install_generator.rb', 'w') do |f|
61
+ f.puts <<-EOF
62
+ require 'rails/generators'
63
+
64
+ module InternalTestGem
65
+ class InstallGenerator < Rails::Generators::Base
66
+ end
67
+ end
68
+ EOF
69
+ end
70
+
59
71
  system "echo '\ngem \"rspec-rails\"\n' >> Gemfile"
60
72
  if RUBY_VERSION < '3.0'
61
73
  system "echo '\ngem \"sqlite3\", \"< 1.7.0\"\n' >> Gemfile"
data/engine_cart.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'rails', '>= 5.0'
21
+ spec.add_dependency 'rails', '>= 6.1'
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
24
  end
@@ -1,6 +1,6 @@
1
1
  module EngineCart
2
2
  def self.gemfile_stanza_check_line
3
- 'engine_cart stanza: 2.5.0'
3
+ 'engine_cart stanza: 2.6.0'
4
4
  end
5
5
 
6
6
  def self.gemfile_stanza_text
@@ -23,20 +23,10 @@ module EngineCart
23
23
  if ENV['RAILS_VERSION']
24
24
  if ENV['RAILS_VERSION'] == 'edge'
25
25
  gem 'rails', github: 'rails/rails'
26
- ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
26
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge'
27
27
  else
28
28
  gem 'rails', ENV['RAILS_VERSION']
29
29
  end
30
-
31
- case ENV['RAILS_VERSION']
32
- when /^6.0/
33
- gem 'sass-rails', '>= 6'
34
- gem 'webpacker', '~> 4.0'
35
- when /^5.[12]/
36
- gem 'sass-rails', '~> 5.0'
37
- gem 'sprockets', '~> 3.7'
38
- gem 'thor', '~> 0.20'
39
- end
40
30
  end
41
31
  end
42
32
  # END ENGINE_CART BLOCK
@@ -27,7 +27,6 @@ namespace :engine_cart do
27
27
  task :create_test_rails_app => [:setup] do
28
28
  require 'tmpdir'
29
29
  require 'fileutils'
30
- require 'rails/version'
31
30
 
32
31
  Dir.mktmpdir do |dir|
33
32
  # Fork into a new process to avoid polluting the current one with the partial Rails environment ...
@@ -39,6 +38,7 @@ namespace :engine_cart do
39
38
  # Clear out our current bundle so that the rails generator can run with it's own bundle
40
39
  backup_gemfile = ENV['BUNDLE_GEMFILE']
41
40
  ENV.delete('BUNDLE_GEMFILE')
41
+ backup_lockfile = ENV.delete('BUNDLE_LOCKFILE')
42
42
 
43
43
  # Using the Rails generator directly, instead of shelling out, to
44
44
  # ensure we use the right version of Rails.
@@ -56,6 +56,7 @@ namespace :engine_cart do
56
56
 
57
57
  # Restore our gemfile
58
58
  ENV['BUNDLE_GEMFILE'] = backup_gemfile
59
+ ENV['BUNDLE_LOCKFILE'] = backup_lockfile
59
60
 
60
61
  end
61
62
  exit 0
@@ -68,15 +69,6 @@ namespace :engine_cart do
68
69
  Rake::Task['engine_cart:clean'].invoke if File.exist? EngineCart.destination
69
70
  FileUtils.move "#{dir}/internal", "#{EngineCart.destination}"
70
71
 
71
- if Rails.version < '5.2.3'
72
- # Hack for https://github.com/rails/rails/issues/35153
73
- gemfile = File.join(EngineCart.destination, 'Gemfile')
74
- IO.write(gemfile, File.open(gemfile) do |f|
75
- text = f.read
76
- text.gsub(/^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"')
77
- end)
78
- end
79
-
80
72
  if RUBY_VERSION < '3.0'
81
73
  # Hack for https://github.com/cbeer/engine_cart/issues/125
82
74
  gemfile = File.join(EngineCart.destination, 'Gemfile')
@@ -1,3 +1,3 @@
1
1
  module EngineCart
2
- VERSION = '2.6.0'
2
+ VERSION = '2.7.0'
3
3
  end
@@ -31,6 +31,15 @@ describe "EngineCart powered application" do
31
31
  end
32
32
  end
33
33
 
34
+ it "should run the rails app generator's bundled installers when the engine_cart:generate task is invoked" do
35
+ EngineCart.within_test_app do
36
+ FileUtils.rm_rf('.internal_test_app')
37
+ output = `bundle exec rake engine_cart:generate 2>&1`
38
+ expect(output).not_to include('Bundler::GemNotFound')
39
+ expect(File).to exist(File.expand_path('.internal_test_app/config/importmap.rb'))
40
+ end
41
+ end
42
+
34
43
  it "should not recreate an existing rails app when the engine_cart:generate task is reinvoked" do
35
44
  EngineCart.within_test_app do
36
45
  `bundle exec rake engine_cart:generate`
@@ -69,6 +78,7 @@ describe "EngineCart powered application" do
69
78
  EOF
70
79
  end
71
80
 
81
+ `bundle exec rake engine_cart:generate`
72
82
  `bundle exec rspec spec/some_spec.rb`
73
83
  expect($?).to eq 0
74
84
  end
@@ -90,6 +100,7 @@ describe "EngineCart powered application" do
90
100
  EOF
91
101
  end
92
102
 
103
+ `bundle exec rake engine_cart:generate`
93
104
  `bundle exec rspec spec/require_spec.rb`
94
105
  expect($?).to eq 0
95
106
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engine_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '5.0'
18
+ version: '6.1'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '5.0'
25
+ version: '6.1'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: rake
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +80,6 @@ homepage: https://github.com/cbeer/engine_cart
81
80
  licenses:
82
81
  - MIT
83
82
  metadata: {}
84
- post_install_message:
85
83
  rdoc_options: []
86
84
  require_paths:
87
85
  - lib
@@ -96,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
94
  - !ruby/object:Gem::Version
97
95
  version: '0'
98
96
  requirements: []
99
- rubygems_version: 3.4.20
100
- signing_key:
97
+ rubygems_version: 4.0.22
101
98
  specification_version: 4
102
99
  summary: Helper for testing Rails Engines sanely
103
100
  test_files: