engine_cart 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +11 -3
- data/Rakefile +5 -2
- data/lib/engine_cart/tasks/engine_cart.rake +20 -9
- data/lib/engine_cart/version.rb +1 -1
- data/lib/engine_cart.rb +13 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 864ca4cc0c524ad80281f92e1dce77df32cb2a2c4b6f27d293721ee8e9305412
|
4
|
+
data.tar.gz: 5c8ec70e88e2a6efd9d919c04c56be20509afebacce106118d3061de56a40cfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 324a7c844887c7f43923d6d8dadd72f599567158ad6bd8876496865700239be2a28a0314feef816e7ce2b8cb5dff405b4d6bc3ec93d8912ac8e7bb13554e56b1
|
7
|
+
data.tar.gz: f377f63b4585553142802de3451eaaa4882de55bd821976e45c892e820d43bb708ef9c6afba7d166a883d8150be6d03bfdaec62aa93614d9a21ce521eb8e7d10
|
data/.github/workflows/ci.yml
CHANGED
@@ -12,18 +12,26 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
14
|
ruby:
|
15
|
-
-
|
15
|
+
- 3.1
|
16
16
|
rails_version:
|
17
|
-
- 5.2.8.1
|
18
|
-
- 6.0.5.1
|
19
17
|
- 6.1.6.1
|
20
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'
|
21
28
|
steps:
|
22
29
|
- uses: actions/checkout@v2
|
23
30
|
- name: Set up Ruby
|
24
31
|
uses: ruby/setup-ruby@v1
|
25
32
|
with:
|
26
33
|
ruby-version: ${{ matrix.ruby }}
|
34
|
+
bundler: 'latest'
|
27
35
|
- name: Install dependencies
|
28
36
|
run: bundle install
|
29
37
|
env:
|
data/Rakefile
CHANGED
@@ -57,12 +57,15 @@ task :generate_test_gem => ['engine_cart:setup'] do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
system "echo '\ngem \"rspec-rails\"\n' >> Gemfile"
|
60
|
+
if RUBY_VERSION < '3.0'
|
61
|
+
system "echo '\ngem \"sqlite3\", \"< 1.7.0\"\n' >> Gemfile"
|
62
|
+
end
|
60
63
|
|
61
|
-
Bundler.
|
64
|
+
Bundler.unbundled_system "bundle update --quiet"
|
62
65
|
system "echo 'require \"engine_cart/rake_task\"\n' >> Rakefile"
|
63
66
|
|
64
67
|
system("bundle exec rake engine_cart:prepare")
|
65
|
-
Bundler.
|
68
|
+
Bundler.unbundled_system "bundle install --quiet"
|
66
69
|
end
|
67
70
|
end
|
68
71
|
|
@@ -27,6 +27,8 @@ 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
|
Dir.mktmpdir do |dir|
|
31
33
|
# Fork into a new process to avoid polluting the current one with the partial Rails environment ...
|
32
34
|
pid = fork do
|
@@ -66,7 +68,7 @@ namespace :engine_cart do
|
|
66
68
|
Rake::Task['engine_cart:clean'].invoke if File.exist? EngineCart.destination
|
67
69
|
FileUtils.move "#{dir}/internal", "#{EngineCart.destination}"
|
68
70
|
|
69
|
-
if
|
71
|
+
if Rails.version < '5.2.3'
|
70
72
|
# Hack for https://github.com/rails/rails/issues/35153
|
71
73
|
gemfile = File.join(EngineCart.destination, 'Gemfile')
|
72
74
|
IO.write(gemfile, File.open(gemfile) do |f|
|
@@ -74,6 +76,15 @@ namespace :engine_cart do
|
|
74
76
|
text.gsub(/^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"')
|
75
77
|
end)
|
76
78
|
end
|
79
|
+
|
80
|
+
if RUBY_VERSION < '3.0'
|
81
|
+
# Hack for https://github.com/cbeer/engine_cart/issues/125
|
82
|
+
gemfile = File.join(EngineCart.destination, 'Gemfile')
|
83
|
+
IO.write(gemfile, File.open(gemfile) do |f|
|
84
|
+
text = f.read
|
85
|
+
text.gsub(/^gem ["']sqlite3["']$/, 'gem "sqlite3", "< 1.7"')
|
86
|
+
end)
|
87
|
+
end
|
77
88
|
end
|
78
89
|
end
|
79
90
|
|
@@ -106,19 +117,19 @@ namespace :engine_cart do
|
|
106
117
|
|
107
118
|
# Copy our test app generators into the app and prepare it
|
108
119
|
if File.exist? "#{EngineCart.templates_path}/lib/generators"
|
109
|
-
Bundler.
|
120
|
+
Bundler.unbundled_system "cp -r #{EngineCart.templates_path}/lib/generators #{EngineCart.destination}/lib"
|
110
121
|
end
|
111
122
|
|
112
123
|
within_test_app do
|
113
124
|
unless (system("bundle install --quiet") or system("bundle update --quiet")) and
|
114
|
-
system "(
|
115
|
-
system "
|
116
|
-
system "
|
125
|
+
system "(bin/rails g | grep test_app) && bin/rails generate test_app" and
|
126
|
+
system "bin/rails db:migrate" and
|
127
|
+
system "bin/rails db:test:prepare"
|
117
128
|
raise "EngineCart failed on with: #{$?}"
|
118
129
|
end
|
119
130
|
end
|
120
131
|
|
121
|
-
Bundler.
|
132
|
+
Bundler.unbundled_system "bundle install --quiet"
|
122
133
|
|
123
134
|
EngineCart.write_fingerprint
|
124
135
|
|
@@ -129,14 +140,14 @@ namespace :engine_cart do
|
|
129
140
|
desc 'Start the internal test application using `rails server`'
|
130
141
|
task :server, [:rails_server_args] => [:generate] do |_, args|
|
131
142
|
within_test_app do
|
132
|
-
system "
|
143
|
+
system "bin/rails server #{args[:rails_server_args]}"
|
133
144
|
end
|
134
145
|
end
|
135
146
|
|
136
147
|
desc 'Start the internal test application using `rails console`'
|
137
148
|
task :console, [:rails_console_args] => [:generate] do |_, args|
|
138
149
|
within_test_app do
|
139
|
-
system "
|
150
|
+
system "bin/rails console #{args[:rails_console_args]}"
|
140
151
|
end
|
141
152
|
end
|
142
153
|
end
|
@@ -144,7 +155,7 @@ end
|
|
144
155
|
def within_test_app
|
145
156
|
puts "\rtravis_fold:start:enginecart-bundler-cleanenv\r" if ENV['TRAVIS'] == 'true'
|
146
157
|
Dir.chdir(EngineCart.destination) do
|
147
|
-
|
158
|
+
EngineCart.with_unbundled_env do
|
148
159
|
yield
|
149
160
|
end
|
150
161
|
end
|
data/lib/engine_cart/version.rb
CHANGED
data/lib/engine_cart.rb
CHANGED
@@ -12,9 +12,21 @@ module EngineCart
|
|
12
12
|
require File.expand_path("config/environment", path || EngineCart.destination)
|
13
13
|
end
|
14
14
|
|
15
|
+
def self.with_unbundled_env
|
16
|
+
method = if Bundler.respond_to?(:with_unbundled_env)
|
17
|
+
:with_unbundled_env
|
18
|
+
else
|
19
|
+
:with_clean_env
|
20
|
+
end
|
21
|
+
|
22
|
+
Bundler.public_send(method) do
|
23
|
+
yield
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
15
27
|
def self.within_test_app
|
16
28
|
Dir.chdir(EngineCart.destination) do
|
17
|
-
|
29
|
+
EngineCart.with_unbundled_env do
|
18
30
|
yield
|
19
31
|
end
|
20
32
|
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: 2.
|
4
|
+
version: 2.6.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:
|
11
|
+
date: 2024-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
99
|
+
rubygems_version: 3.4.20
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Helper for testing Rails Engines sanely
|