engine_cart 2.4.0 → 2.6.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 +4 -4
- data/.github/workflows/ci.yml +13 -4
- data/Rakefile +16 -8
- data/lib/engine_cart/configuration.rb +4 -2
- data/lib/engine_cart/tasks/engine_cart.rake +20 -8
- data/lib/engine_cart/version.rb +1 -1
- data/lib/engine_cart.rb +13 -1
- metadata +6 -6
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,17 +12,26 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
14
|
ruby:
|
|
15
|
-
-
|
|
15
|
+
- 3.1
|
|
16
16
|
rails_version:
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
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'
|
|
20
28
|
steps:
|
|
21
29
|
- uses: actions/checkout@v2
|
|
22
30
|
- name: Set up Ruby
|
|
23
31
|
uses: ruby/setup-ruby@v1
|
|
24
32
|
with:
|
|
25
33
|
ruby-version: ${{ matrix.ruby }}
|
|
34
|
+
bundler: 'latest'
|
|
26
35
|
- name: Install dependencies
|
|
27
36
|
run: bundle install
|
|
28
37
|
env:
|
data/Rakefile
CHANGED
|
@@ -25,12 +25,17 @@ task :generate_test_gem => ['engine_cart:setup'] do
|
|
|
25
25
|
|
|
26
26
|
system("mv #{Dir.pwd}/internal_test_gem #{Dir.pwd}/.internal_test_gem")
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
gemspec_data = File.open(".internal_test_gem/internal_test_gem.gemspec") do |f|
|
|
29
|
+
f.read.gsub(/FIXME/, "DONTCARE")
|
|
30
|
+
.gsub(/TODO/, "DONTCARE")
|
|
31
|
+
.gsub(/.*homepage.*/, "")
|
|
32
|
+
.gsub(/.*sqlite3.*/, "")
|
|
33
|
+
.gsub(/.*source_code_uri.*/, "")
|
|
34
|
+
.gsub(/.*changelog_uri.*/, "")
|
|
35
|
+
end
|
|
36
|
+
|
|
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.*/, "")})
|
|
34
39
|
|
|
35
40
|
Rake::Task['engine_cart:inject_gemfile_extras'].invoke
|
|
36
41
|
EngineCart.within_test_app do
|
|
@@ -52,12 +57,15 @@ task :generate_test_gem => ['engine_cart:setup'] do
|
|
|
52
57
|
end
|
|
53
58
|
|
|
54
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
|
|
55
63
|
|
|
56
|
-
Bundler.
|
|
64
|
+
Bundler.unbundled_system "bundle update --quiet"
|
|
57
65
|
system "echo 'require \"engine_cart/rake_task\"\n' >> Rakefile"
|
|
58
66
|
|
|
59
67
|
system("bundle exec rake engine_cart:prepare")
|
|
60
|
-
Bundler.
|
|
68
|
+
Bundler.unbundled_system "bundle install --quiet"
|
|
61
69
|
end
|
|
62
70
|
end
|
|
63
71
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'yaml'
|
|
2
2
|
require 'erb'
|
|
3
|
+
require 'shellwords'
|
|
3
4
|
|
|
4
5
|
module EngineCart
|
|
5
6
|
class Configuration
|
|
@@ -86,10 +87,11 @@ module EngineCart
|
|
|
86
87
|
# Split a string of options into individual options.
|
|
87
88
|
# @example
|
|
88
89
|
# parse_options('--skip-foo --skip-bar -d postgres --skip-lala')
|
|
89
|
-
# # => ["--skip-foo", "--skip-bar", "-d postgres", "--skip-lala"]
|
|
90
|
+
# # => ["--skip-foo", "--skip-bar", "-d", "postgres", "--skip-lala"]
|
|
90
91
|
def parse_options(options)
|
|
91
92
|
return if options.nil?
|
|
92
|
-
|
|
93
|
+
|
|
94
|
+
Shellwords.shellwords(options)
|
|
93
95
|
end
|
|
94
96
|
|
|
95
97
|
def read_config(config_file)
|
|
@@ -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,18 +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 "
|
|
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"
|
|
116
128
|
raise "EngineCart failed on with: #{$?}"
|
|
117
129
|
end
|
|
118
130
|
end
|
|
119
131
|
|
|
120
|
-
Bundler.
|
|
132
|
+
Bundler.unbundled_system "bundle install --quiet"
|
|
121
133
|
|
|
122
134
|
EngineCart.write_fingerprint
|
|
123
135
|
|
|
@@ -128,14 +140,14 @@ namespace :engine_cart do
|
|
|
128
140
|
desc 'Start the internal test application using `rails server`'
|
|
129
141
|
task :server, [:rails_server_args] => [:generate] do |_, args|
|
|
130
142
|
within_test_app do
|
|
131
|
-
system "
|
|
143
|
+
system "bin/rails server #{args[:rails_server_args]}"
|
|
132
144
|
end
|
|
133
145
|
end
|
|
134
146
|
|
|
135
147
|
desc 'Start the internal test application using `rails console`'
|
|
136
148
|
task :console, [:rails_console_args] => [:generate] do |_, args|
|
|
137
149
|
within_test_app do
|
|
138
|
-
system "
|
|
150
|
+
system "bin/rails console #{args[:rails_console_args]}"
|
|
139
151
|
end
|
|
140
152
|
end
|
|
141
153
|
end
|
|
@@ -143,7 +155,7 @@ end
|
|
|
143
155
|
def within_test_app
|
|
144
156
|
puts "\rtravis_fold:start:enginecart-bundler-cleanenv\r" if ENV['TRAVIS'] == 'true'
|
|
145
157
|
Dir.chdir(EngineCart.destination) do
|
|
146
|
-
|
|
158
|
+
EngineCart.with_unbundled_env do
|
|
147
159
|
yield
|
|
148
160
|
end
|
|
149
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
|
-
autorequire:
|
|
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
|
|
@@ -81,7 +81,7 @@ homepage: https://github.com/cbeer/engine_cart
|
|
|
81
81
|
licenses:
|
|
82
82
|
- MIT
|
|
83
83
|
metadata: {}
|
|
84
|
-
post_install_message:
|
|
84
|
+
post_install_message:
|
|
85
85
|
rdoc_options: []
|
|
86
86
|
require_paths:
|
|
87
87
|
- lib
|
|
@@ -96,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
97
|
version: '0'
|
|
98
98
|
requirements: []
|
|
99
|
-
rubygems_version: 3.
|
|
100
|
-
signing_key:
|
|
99
|
+
rubygems_version: 3.4.20
|
|
100
|
+
signing_key:
|
|
101
101
|
specification_version: 4
|
|
102
102
|
summary: Helper for testing Rails Engines sanely
|
|
103
103
|
test_files:
|