combustion 1.5.0 → 1.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: 022c30e0d3b5dd020d5765951897e91fd4d33725c87b54ce0370e2fdcaea67c8
4
- data.tar.gz: 5f53fd6cef1a7c7c92f9618d37b852d446d565edc3019a2cd0a96f244c08c2e2
3
+ metadata.gz: 1d2797e2ea24494eaab910d769ebe2261b51798415548227c6eb31b98e3cd69e
4
+ data.tar.gz: 2febf7d0b905f4cabe6c097a2ca18efa983750cbf1c588b1ea73509a3160a509
5
5
  SHA512:
6
- metadata.gz: 3bacc58fd39c3708d26623631bb021f0a8c912e64ea9733cc6426dddeba9861e0a1af8fa75f7de18ebd6b3d567a873460d633976e263ce7f500c2224831546eb
7
- data.tar.gz: de2cfdd55a3169eb14c89f3db2090f12b6df84dbeed539b13627c20eb7b696ff1ebef2be6b76c7bdbe2b4e609d2c6a727eabec142e9e9020859e34a91dd979d6
6
+ metadata.gz: acb4a683a993d61a81d372f90fd1a34cef3476b9e8bcc8c9c2255db17d471c1e9885e84a0e629fb4914ab5e7d083c0a420cf04f1be96f0a814f802616b2c625d
7
+ data.tar.gz: 5a6f4291cee25dda4fd77c132d01077cf93ddc923279fa02a7bf4842285c1fab2b843a53befba776f030346c3f86d76ad73ab09798780a5a60500682bc8eb6ad
data/Appraisals CHANGED
@@ -25,24 +25,29 @@ if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 3.1
25
25
  gem "mysql2", "~> 0.5.0"
26
26
  gem "sqlite3", "~> 1.4", "< 1.5.0"
27
27
  gem "activerecord-trilogy-adapter", "~> 3.1"
28
+ gem "concurrent-ruby", "< 1.3.5"
28
29
  end
29
30
  end
30
31
 
31
- if RUBY_VERSION.to_f >= 2.5
32
+ if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 4.0
32
33
  appraise "rails-6.1" do
33
34
  gem "rails", "~> 6.1.0"
34
35
  gem "mysql2", "~> 0.5.0"
35
36
  gem "sqlite3", "~> 1.4", "< 1.6.0"
36
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
37
40
  end
38
41
  end
39
42
 
40
- if RUBY_VERSION.to_f >= 2.7
43
+ if RUBY_VERSION.to_f >= 3.0
41
44
  appraise "rails-7.0" do
42
45
  gem "rails", "~> 7.0.1"
43
46
  gem "mysql2", "~> 0.5.0"
44
47
  gem "sqlite3", "~> 1.4"
45
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
46
51
  end
47
52
 
48
53
  appraise "rails-7.1" do
@@ -53,11 +58,27 @@ if RUBY_VERSION.to_f >= 2.7
53
58
  end
54
59
  end
55
60
 
56
- if RUBY_VERSION.to_f >= 3.1
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
57
78
  appraise "rails-edge" do
58
79
  gem "rails", :git => "https://github.com/rails/rails.git", :branch => "main"
59
80
  gem "mysql2", "~> 0.5.0"
60
- gem "sqlite3", "~> 1.4"
61
- gem "trilogy", "~> 2.7"
81
+ gem "sqlite3", "~> 2.1"
82
+ gem "trilogy", "~> 2.9"
62
83
  end
63
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
- # Required for testing Rails 6.1 on MRI 3.1+
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.4 to 3.1, and Rails 3.1 to 7.0. It will possibly work on older versions and other Ruby implementations as well.
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/master/Appraisals) of Rails.
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-2021, 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).
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
@@ -12,7 +12,7 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
12
12
  private
13
13
 
14
14
  def charset
15
- configuration[:charset] || ENV["CHARSET"] || "utf8"
15
+ configuration[:charset] || ENV["CHARSET"]
16
16
  end
17
17
 
18
18
  def charset_error
@@ -22,7 +22,7 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
22
22
  end
23
23
 
24
24
  def collation
25
- configuration[:collation] || ENV["COLLATION"] || "utf8_unicode_ci"
25
+ configuration[:collation] || ENV["COLLATION"]
26
26
  end
27
27
 
28
28
  def create
@@ -46,7 +46,7 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
46
46
  end
47
47
 
48
48
  def creation_options
49
- {:charset => charset, :collation => collation}
49
+ {:charset => charset, :collation => collation}.compact
50
50
  end
51
51
 
52
52
  def drop
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(options)
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.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-07-07 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: activesupport
@@ -128,14 +127,14 @@ dependencies:
128
127
  requirements:
129
128
  - - "~>"
130
129
  - !ruby/object:Gem::Version
131
- version: 0.81.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.81.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: 3.3.3
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