combustion 1.4.0 → 1.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/Appraisals +30 -4
- data/Gemfile +4 -1
- data/README.md +3 -3
- data/lib/combustion/application.rb +4 -1
- data/lib/combustion/database/reset.rb +1 -1
- data/lib/combustion/databases/mysql.rb +2 -0
- data/lib/combustion.rb +14 -3
- data/spec/include_database_spec.rb +22 -0
- metadata +11 -14
- data/spec/dummy/spec/internal/combustion +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0275fd92cc333b6729a5d6e7e02870093863d650984f6404ebebc31fd3267318
|
|
4
|
+
data.tar.gz: 90127237a18f2c7d76ab833033fc97bc70e600d5b0690aefe9760216f8ea9aea
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 73039b686308ad1e2b01005338352a184f997c534f50cec4336490d6d087849e6bb2616d145d3e5b9f05b5cd195345b7fa4e749dd02588a683423f0afc90a2d6
|
|
7
|
+
data.tar.gz: 3410f78c2cfc778e9b2e26573f5a7dbba06315f3284522ce7f77b92540b57aab2b44ea2cd267c1988069e7ebf911f4ef13c44796c2088ea69191c24c40bfb48d
|
data/Appraisals
CHANGED
|
@@ -24,35 +24,61 @@ if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 3.1
|
|
|
24
24
|
gem "rails", "~> 6.0.0"
|
|
25
25
|
gem "mysql2", "~> 0.5.0"
|
|
26
26
|
gem "sqlite3", "~> 1.4", "< 1.5.0"
|
|
27
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
28
|
+
gem "concurrent-ruby", "< 1.3.5"
|
|
27
29
|
end
|
|
28
30
|
end
|
|
29
31
|
|
|
30
|
-
if RUBY_VERSION.to_f >= 2.5
|
|
32
|
+
if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 4.0
|
|
31
33
|
appraise "rails-6.1" do
|
|
32
34
|
gem "rails", "~> 6.1.0"
|
|
33
35
|
gem "mysql2", "~> 0.5.0"
|
|
34
36
|
gem "sqlite3", "~> 1.4", "< 1.6.0"
|
|
37
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
38
|
+
gem "concurrent-ruby", "< 1.3.5"
|
|
39
|
+
gem "mutex_m", "~> 0.3.0" if RUBY_VERSION.to_f >= 3.4
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
|
|
38
|
-
if RUBY_VERSION.to_f >=
|
|
43
|
+
if RUBY_VERSION.to_f >= 3.0
|
|
39
44
|
appraise "rails-7.0" do
|
|
40
45
|
gem "rails", "~> 7.0.1"
|
|
41
46
|
gem "mysql2", "~> 0.5.0"
|
|
42
47
|
gem "sqlite3", "~> 1.4"
|
|
48
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
49
|
+
gem "concurrent-ruby", "< 1.3.5"
|
|
50
|
+
gem "mutex_m", "~> 0.3.0" if RUBY_VERSION.to_f >= 3.4
|
|
43
51
|
end
|
|
44
52
|
|
|
45
53
|
appraise "rails-7.1" do
|
|
46
54
|
gem "rails", "~> 7.1.2"
|
|
47
55
|
gem "mysql2", "~> 0.5.0"
|
|
48
56
|
gem "sqlite3", "~> 1.4"
|
|
57
|
+
gem "trilogy", "~> 2.7"
|
|
49
58
|
end
|
|
50
59
|
end
|
|
51
60
|
|
|
52
|
-
if RUBY_VERSION.to_f >= 3.
|
|
61
|
+
if RUBY_VERSION.to_f >= 3.2
|
|
62
|
+
appraise "rails-8.0" do
|
|
63
|
+
gem "rails", "~> 8.0.3"
|
|
64
|
+
gem "mysql2", "~> 0.5.0"
|
|
65
|
+
gem "sqlite3", "~> 2.1"
|
|
66
|
+
gem "trilogy", "~> 2.9"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
appraise "rails-8.1" do
|
|
70
|
+
gem "rails", "~> 8.1.1"
|
|
71
|
+
gem "mysql2", "~> 0.5.0"
|
|
72
|
+
gem "sqlite3", "~> 2.1"
|
|
73
|
+
gem "trilogy", "~> 2.9"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if RUBY_VERSION.to_f >= 3.3
|
|
53
78
|
appraise "rails-edge" do
|
|
54
79
|
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "main"
|
|
55
80
|
gem "mysql2", "~> 0.5.0"
|
|
56
|
-
gem "sqlite3", "~> 1
|
|
81
|
+
gem "sqlite3", "~> 2.1"
|
|
82
|
+
gem "trilogy", "~> 2.9"
|
|
57
83
|
end
|
|
58
84
|
end
|
data/Gemfile
CHANGED
|
@@ -5,6 +5,7 @@ source "http://rubygems.org"
|
|
|
5
5
|
gemspec
|
|
6
6
|
|
|
7
7
|
if RUBY_VERSION.to_f < 3.0
|
|
8
|
+
gem "pg", "<= 1.6.2"
|
|
8
9
|
gem "sqlite3", "~> 1.3.13"
|
|
9
10
|
else
|
|
10
11
|
gem "sqlite3", "~> 1.4"
|
|
@@ -13,5 +14,7 @@ end
|
|
|
13
14
|
gem "rubocop", "~> 0.92"
|
|
14
15
|
gem "rubocop-packaging", "~> 0.5"
|
|
15
16
|
|
|
16
|
-
#
|
|
17
|
+
# Gems that are no longer part of stdlib:
|
|
17
18
|
gem "net-smtp" if RUBY_VERSION.to_f > 3.0
|
|
19
|
+
gem "ostruct" if RUBY_VERSION.to_f > 3.4
|
|
20
|
+
gem "stringio" if RUBY_VERSION.to_f > 3.1
|
data/README.md
CHANGED
|
@@ -187,9 +187,9 @@ end
|
|
|
187
187
|
|
|
188
188
|
## Compatibility
|
|
189
189
|
|
|
190
|
-
The current test matrix covers MRI 2.
|
|
190
|
+
The current test matrix covers MRI 2.6 to 4.0, and Rails 5.0 to 8.1 plus the latest in Rails' `main` branch. It will possibly work on older versions and other Ruby implementations as well.
|
|
191
191
|
|
|
192
|
-
You can also use Combustion with multiple versions of Rails to test compatibility across them. [Appraisal](https://github.com/thoughtbot/appraisal) is a gem that can help with this, and a good starting reference is the [Thinking Sphinx](https://github.com/pat/thinking-sphinx) test suite, which runs against [multiple versions](https://github.com/pat/thinking-sphinx/blob/
|
|
192
|
+
You can also use Combustion with multiple versions of Rails to test compatibility across them. [Appraisal](https://github.com/thoughtbot/appraisal) is a gem that can help with this, and a good starting reference is the [Thinking Sphinx](https://github.com/pat/thinking-sphinx) test suite, which runs against [multiple versions](https://github.com/pat/thinking-sphinx/blob/develop/Appraisals) of Rails.
|
|
193
193
|
|
|
194
194
|
## Limitations and Known Issues
|
|
195
195
|
|
|
@@ -210,4 +210,4 @@ The tests are extremely minimal, and patches to extend the suite are especially
|
|
|
210
210
|
|
|
211
211
|
## Credits
|
|
212
212
|
|
|
213
|
-
Copyright (c) 2011-
|
|
213
|
+
Copyright (c) 2011-2026, Combustion is developed and maintained by Pat Allan, and is released under the open MIT Licence. Many thanks to HyperTiny for encouraging its development, and [all who have contributed patches](https://github.com/pat/combustion/contributors).
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "securerandom"
|
|
4
4
|
require "digest"
|
|
5
|
-
Rails.env = ENV["RAILS_ENV"] || "test"
|
|
6
5
|
|
|
7
6
|
module Combustion
|
|
8
7
|
class Application < Rails::Application
|
|
@@ -15,6 +14,10 @@ module Combustion
|
|
|
15
14
|
|
|
16
15
|
rails_gate = VersionGate.new("railties")
|
|
17
16
|
|
|
17
|
+
if rails_gate.call(">= 7.2.0.alpha")
|
|
18
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
|
19
|
+
end
|
|
20
|
+
|
|
18
21
|
# Core Settings
|
|
19
22
|
config.cache_classes = true
|
|
20
23
|
config.consider_all_requests_local = true
|
|
@@ -7,7 +7,7 @@ class Combustion::Database::Reset
|
|
|
7
7
|
UnsupportedDatabase = Class.new StandardError
|
|
8
8
|
|
|
9
9
|
OPERATOR_PATTERNS = {
|
|
10
|
-
Combustion::Databases::MySQL => [/mysql/],
|
|
10
|
+
Combustion::Databases::MySQL => [/mysql/, /trilogy/],
|
|
11
11
|
Combustion::Databases::PostgreSQL => [/postgres/, /postgis/],
|
|
12
12
|
Combustion::Databases::SQLite => [/sqlite/],
|
|
13
13
|
Combustion::Databases::SQLServer => [/sqlserver/],
|
|
@@ -60,6 +60,8 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
60
60
|
ArJdbcMySQL::Error
|
|
61
61
|
elsif configuration[:adapter][/mysql2/] && defined?(Mysql2)
|
|
62
62
|
Mysql2::Error
|
|
63
|
+
elsif configuration[:adapter][/trilogy/] && defined?(Trilogy)
|
|
64
|
+
Trilogy::Error
|
|
63
65
|
else
|
|
64
66
|
Mysql::Error
|
|
65
67
|
end
|
data/lib/combustion.rb
CHANGED
|
@@ -42,15 +42,21 @@ module Combustion
|
|
|
42
42
|
keys
|
|
43
43
|
end.freeze
|
|
44
44
|
|
|
45
|
-
def self.initialize!(*modules, &block)
|
|
45
|
+
def self.initialize!(*modules, &block) # rubocop:disable Metrics/MethodLength
|
|
46
46
|
self.setup_environment = block if block_given?
|
|
47
47
|
|
|
48
|
+
Rails.env = ENV["RAILS_ENV"] || "test"
|
|
49
|
+
|
|
48
50
|
options = modules.extract_options!
|
|
49
51
|
modules = AVAILABLE_MODULES if modules == [:all]
|
|
50
52
|
modules.each { |mod| require MODULES.fetch(mod, "#{mod}/railtie") }
|
|
51
53
|
|
|
52
54
|
Bundler.require :default, Rails.env
|
|
53
55
|
|
|
56
|
+
# intentionally required only after we load framework, to avoid recent Rails
|
|
57
|
+
# order-of-load warnings on initializers etc.
|
|
58
|
+
require "combustion/application"
|
|
59
|
+
|
|
54
60
|
Combustion::Application.configure_for_combustion
|
|
55
61
|
include_database modules, options
|
|
56
62
|
Combustion::Application.initialize!
|
|
@@ -60,8 +66,11 @@ module Combustion
|
|
|
60
66
|
def self.include_database(modules, options)
|
|
61
67
|
return unless modules.map(&:to_s).include? "active_record"
|
|
62
68
|
|
|
69
|
+
# A frozen copy, so Rails can make the block Ractor-shareable
|
|
70
|
+
# (ActiveSupport::Ractors.unshareable_proc_action in Rails 8.2).
|
|
71
|
+
database_options = options.dup.freeze
|
|
63
72
|
Combustion::Application.config.to_prepare do
|
|
64
|
-
Combustion::Database.setup(
|
|
73
|
+
Combustion::Database.setup(database_options)
|
|
65
74
|
end
|
|
66
75
|
end
|
|
67
76
|
|
|
@@ -93,5 +102,7 @@ require "combustion/configurations/action_controller"
|
|
|
93
102
|
require "combustion/configurations/action_mailer"
|
|
94
103
|
require "combustion/configurations/active_record"
|
|
95
104
|
require "combustion/configurations/active_storage"
|
|
96
|
-
require "combustion/application"
|
|
97
105
|
require "combustion/database"
|
|
106
|
+
|
|
107
|
+
# combustion/application is intentionally required lazily in #initialize!, not
|
|
108
|
+
# on boot to avoid recent Rails order-of-load warnings.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Combustion do
|
|
4
|
+
describe ".include_database" do
|
|
5
|
+
# Rails 8.2 makes reloader callbacks Ractor-shareable when
|
|
6
|
+
# ActiveSupport::Ractors.unshareable_proc_action is set, which needs every
|
|
7
|
+
# value the block refers to to be shareable.
|
|
8
|
+
it "registers a prepare block that can be made Ractor-shareable" do
|
|
9
|
+
unless defined?(Ractor) && Ractor.respond_to?(:make_shareable)
|
|
10
|
+
skip "needs Ractor.make_shareable"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
block = nil
|
|
14
|
+
allow(Combustion::Application.config).
|
|
15
|
+
to receive(:to_prepare) { |&hook| block = hook }
|
|
16
|
+
|
|
17
|
+
Combustion.include_database [:active_record], :database_reset => false
|
|
18
|
+
|
|
19
|
+
expect { Ractor.make_shareable(block) }.not_to raise_error
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: combustion
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pat Allan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -128,14 +127,14 @@ dependencies:
|
|
|
128
127
|
requirements:
|
|
129
128
|
- - "~>"
|
|
130
129
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 0.
|
|
130
|
+
version: '0.92'
|
|
132
131
|
type: :development
|
|
133
132
|
prerelease: false
|
|
134
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
134
|
requirements:
|
|
136
135
|
- - "~>"
|
|
137
136
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: 0.
|
|
137
|
+
version: '0.92'
|
|
139
138
|
- !ruby/object:Gem::Dependency
|
|
140
139
|
name: sqlite3
|
|
141
140
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -191,10 +190,10 @@ files:
|
|
|
191
190
|
- spec/dummy/spec/internal/app/assets/config/manifest.js
|
|
192
191
|
- spec/dummy/spec/internal/app/models/model.rb
|
|
193
192
|
- spec/dummy/spec/internal/app/models/model_in_another_db.rb
|
|
194
|
-
- spec/dummy/spec/internal/combustion
|
|
195
193
|
- spec/dummy/spec/internal/config/database.yml
|
|
196
194
|
- spec/dummy/spec/internal/config/routes.rb
|
|
197
195
|
- spec/dummy/spec/internal/db/schema.rb
|
|
196
|
+
- spec/include_database_spec.rb
|
|
198
197
|
- spec/spec_helper.rb
|
|
199
198
|
- templates/config.ru
|
|
200
199
|
- templates/database.yml
|
|
@@ -206,7 +205,6 @@ licenses:
|
|
|
206
205
|
- MIT
|
|
207
206
|
metadata:
|
|
208
207
|
rubygems_mfa_required: 'true'
|
|
209
|
-
post_install_message:
|
|
210
208
|
rdoc_options: []
|
|
211
209
|
require_paths:
|
|
212
210
|
- lib
|
|
@@ -221,11 +219,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
221
219
|
- !ruby/object:Gem::Version
|
|
222
220
|
version: '0'
|
|
223
221
|
requirements: []
|
|
224
|
-
rubygems_version:
|
|
225
|
-
signing_key:
|
|
222
|
+
rubygems_version: 4.0.20
|
|
226
223
|
specification_version: 4
|
|
227
224
|
summary: Elegant Rails Engine Testing
|
|
228
225
|
test_files:
|
|
226
|
+
- ".rspec"
|
|
227
|
+
- Appraisals
|
|
228
|
+
- Gemfile
|
|
229
|
+
- Rakefile
|
|
229
230
|
- spec/database_spec.rb
|
|
230
231
|
- spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
|
|
231
232
|
- spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
|
|
@@ -233,12 +234,8 @@ test_files:
|
|
|
233
234
|
- spec/dummy/spec/internal/app/assets/config/manifest.js
|
|
234
235
|
- spec/dummy/spec/internal/app/models/model.rb
|
|
235
236
|
- spec/dummy/spec/internal/app/models/model_in_another_db.rb
|
|
236
|
-
- spec/dummy/spec/internal/combustion
|
|
237
237
|
- spec/dummy/spec/internal/config/database.yml
|
|
238
238
|
- spec/dummy/spec/internal/config/routes.rb
|
|
239
239
|
- spec/dummy/spec/internal/db/schema.rb
|
|
240
|
+
- spec/include_database_spec.rb
|
|
240
241
|
- spec/spec_helper.rb
|
|
241
|
-
- ".rspec"
|
|
242
|
-
- Appraisals
|
|
243
|
-
- Gemfile
|
|
244
|
-
- Rakefile
|
|
Binary file
|