combustion 1.3.1 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6757c9291746515078aa689da7f819b5a3679546b55cd9f2d64d6a2d4ac66f5
4
- data.tar.gz: 2b1b3e0f92d8e8b07c1fa8678f88e36b5ceb5cda01246ef4528c95b5d4022429
3
+ metadata.gz: '08458ed30f386ac27b19a50f31ebfa268b27cd2851f5e784ab9c9684e5e8591e'
4
+ data.tar.gz: 53410691043777b5fcb81b06ddf0d415e17bdcd81f1e0382db354fb3a8002b4a
5
5
  SHA512:
6
- metadata.gz: ec5405a6b9a3219ee33cba45ced79b68850bf6a0d29738af684c94586d6bb6ee3826be5042780cfb131a9f1b3ce38cf11ab3597965c7991f05c0560f1d69aa68
7
- data.tar.gz: 736d397893838938051ca0a58c199ea595500adeb9bc40a115c42c2f930020a49ecf31267374286db081974a226e3f178527aa9a2ba318d694e745dacd145542
6
+ metadata.gz: 7fb571edaf37a71657c218d57600c56faf2e5bfaabb0b90155cfb10716073ee11f9044eda12b2808819ba8c0a7ed85a5a5446f209a99c6d1fc347607fc145e13
7
+ data.tar.gz: 9d5667930b7bde63172f2a2accb24ca2e09ddb7ae88c33548d8eec0b9cfb6fc16870ddf9c3558de0c9e9a815929ebfe6d3099467cb19458459259b5915ba5877
data/Appraisals CHANGED
@@ -37,21 +37,23 @@ if RUBY_VERSION.to_f <= 2.3
37
37
  end
38
38
  end
39
39
 
40
- appraise "rails-5.0" do
41
- gem "rails", "~> 5.0.2"
42
- gem "mysql2", "~> 0.4.4"
43
- gem "pg", "< 1.0"
44
- end
40
+ if RUBY_VERSION.to_f < 3.0
41
+ appraise "rails-5.0" do
42
+ gem "rails", "~> 5.0.2"
43
+ gem "mysql2", "~> 0.4.4"
44
+ gem "pg", "< 1.0"
45
+ end
45
46
 
46
- appraise "rails-5.1" do
47
- gem "rails", "~> 5.1.0"
48
- gem "mysql2", "~> 0.4.4"
49
- gem "pg", "< 1.0"
50
- end
47
+ appraise "rails-5.1" do
48
+ gem "rails", "~> 5.1.0"
49
+ gem "mysql2", "~> 0.4.4"
50
+ gem "pg", "< 1.0"
51
+ end
51
52
 
52
- appraise "rails-5.2" do
53
- gem "rails", "~> 5.2.0"
54
- gem "mysql2", "~> 0.5.0"
53
+ appraise "rails-5.2" do
54
+ gem "rails", "~> 5.2.0"
55
+ gem "mysql2", "~> 0.5.0"
56
+ end
55
57
  end
56
58
 
57
59
  if RUBY_VERSION.to_f >= 2.5
@@ -61,9 +63,22 @@ if RUBY_VERSION.to_f >= 2.5
61
63
  gem "sqlite3", "~> 1.4"
62
64
  end
63
65
 
66
+ appraise "rails-6.1" do
67
+ gem "rails", "~> 6.1.0"
68
+ gem "mysql2", "~> 0.5.0"
69
+ gem "sqlite3", "~> 1.4"
70
+ end
71
+ end
72
+
73
+ if RUBY_VERSION.to_f >= 2.7
74
+ appraise "rails-7.0" do
75
+ gem "rails", "~> 7.0.0.alpha2"
76
+ gem "mysql2", "~> 0.5.0"
77
+ gem "sqlite3", "~> 1.4"
78
+ end
79
+
64
80
  appraise "rails-edge" do
65
- gem "rails", :git => "https://github.com/rails/rails.git"
66
- gem "arel", :git => "https://github.com/rails/arel.git"
81
+ gem "rails", :git => "https://github.com/rails/rails.git", :branch => "main"
67
82
  gem "mysql2", "~> 0.5.0"
68
83
  gem "sqlite3", "~> 1.4"
69
84
  end
data/Gemfile CHANGED
@@ -4,7 +4,11 @@ source "http://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- gem "sqlite3", "~> 1.3.13"
7
+ if RUBY_VERSION.to_f < 3.0
8
+ gem "sqlite3", "~> 1.3.13"
9
+ else
10
+ gem "sqlite3", "~> 1.4"
11
+ end
8
12
 
9
13
  if RUBY_VERSION.to_f < 2.3
10
14
  gem "i18n", "< 1.6"
data/README.md CHANGED
@@ -37,6 +37,8 @@ RSpec.configure do |config|
37
37
  end
38
38
  ```
39
39
 
40
+ Please note that using `:all` as an argument for `Combustion.initialize!` will load all key parts of Rails that are considered essential for that version. For example: ActiveJob is only loaded for Rails 4.2 onwards, and Sprockets is only loaded for Rails 3.1-6.1 (as it is no longer part of the default set in 7.0).
41
+
40
42
  You'll also want to run the generator that creates a minimal set of files expected by Rails - run this in the directory of your engine:
41
43
 
42
44
  ```shell
@@ -208,4 +210,4 @@ The tests are extremely minimal, and patches to extend the suite are especially
208
210
 
209
211
  ## Credits
210
212
 
211
- Copyright (c) 2011-2017, 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-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).
@@ -3,6 +3,11 @@
3
3
  class Combustion::Configurations::ActiveRecord
4
4
  def self.call(config)
5
5
  return unless defined?(ActiveRecord::Railtie)
6
+
7
+ if ActiveRecord::VERSION::MAJOR >= 7
8
+ config.active_record.legacy_connection_handling = false
9
+ end
10
+
6
11
  return unless ::ActiveRecord.constants.include?(:MassAssignmentSecurity)
7
12
 
8
13
  # Turn on ActiveRecord attribute whitelisting
data/lib/combustion.rb CHANGED
@@ -12,30 +12,39 @@ module Combustion
12
12
  self.path = "/spec/internal"
13
13
  self.schema_format = :ruby
14
14
 
15
- MODULES = begin
16
- hash = {
17
- :active_model => "active_model/railtie",
18
- :active_record => "active_record/railtie",
19
- :action_controller => "action_controller/railtie",
20
- :action_mailer => "action_mailer/railtie",
21
- :action_view => "action_view/railtie"
22
- }
23
-
24
- hash[:sprockets] = "sprockets/railtie" if Rails.version.to_f >= 3.1
25
- hash[:active_job] = "active_job/railtie" if Rails.version.to_f >= 4.2
26
- hash[:action_cable] = "action_cable/engine" if Rails.version.to_f >= 5.0
27
- hash[:active_storage] = "active_storage/engine" if Rails.version.to_f >= 5.2
28
- hash[:action_text] = "action_text/engine" if Rails.version.to_f >= 6.0
29
- hash[:action_mailbox] = "action_mailbox/engine" if Rails.version.to_f >= 6.0
30
-
31
- hash
15
+ MODULES = {
16
+ :active_model => "active_model/railtie",
17
+ :active_record => "active_record/railtie",
18
+ :action_controller => "action_controller/railtie",
19
+ :action_mailer => "action_mailer/railtie",
20
+ :action_view => "action_view/railtie",
21
+ :sprockets => "sprockets/railtie",
22
+ :active_job => "active_job/railtie",
23
+ :action_cable => "action_cable/engine",
24
+ :active_storage => "active_storage/engine",
25
+ :action_text => "action_text/engine",
26
+ :action_mailbox => "action_mailbox/engine"
27
+ }.freeze
28
+
29
+ AVAILABLE_MODULES = begin
30
+ keys = MODULES.keys
31
+ version = Rails.version.to_f
32
+
33
+ keys.delete(:sprockets) unless (3.1..6.1).include?(version)
34
+ keys.delete(:active_job) unless version >= 4.2
35
+ keys.delete(:action_cable) unless version >= 5.0
36
+ keys.delete(:active_storage) unless version >= 5.2
37
+ keys.delete(:action_text) unless version >= 6.0
38
+ keys.delete(:action_mailbox) unless version >= 6.0
39
+
40
+ keys
32
41
  end.freeze
33
42
 
34
43
  def self.initialize!(*modules, &block)
35
44
  self.setup_environment = block if block_given?
36
45
 
37
46
  options = modules.extract_options!
38
- modules = MODULES.keys if modules == [:all]
47
+ modules = AVAILABLE_MODULES if modules == [:all]
39
48
  modules.each { |mod| require MODULES.fetch(mod, "#{mod}/railtie") }
40
49
 
41
50
  Bundler.require :default, Rails.env
@@ -9,6 +9,10 @@ test: &defaults
9
9
  username: <%= ENV["DB_USERNAME"] %>
10
10
  <% end %>
11
11
 
12
+ <% if ENV["DB_PASSWORD"] %>
13
+ password: <%= ENV["DB_PASSWORD"] %>
14
+ <% end %>
15
+
12
16
 
13
17
  test_another:
14
18
  <<: *defaults
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combustion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-01 00:00:00.000000000 Z
11
+ date: 2021-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.1.0
61
+ version: '2.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.1.0
68
+ version: '2.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mysql2
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0.81'
131
+ version: 0.81.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0.81'
138
+ version: 0.81.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sqlite3
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -193,10 +193,6 @@ files:
193
193
  - spec/dummy/spec/internal/config/database.yml
194
194
  - spec/dummy/spec/internal/config/routes.rb
195
195
  - spec/dummy/spec/internal/db/schema.rb
196
- - spec/dummy/spec/internal/log/development.log
197
- - spec/dummy/spec/internal/log/test.log
198
- - spec/dummy/spec/internal/test
199
- - spec/dummy/spec/internal/test_another
200
196
  - spec/spec_helper.rb
201
197
  - templates/config.ru
202
198
  - templates/database.yml
@@ -206,8 +202,9 @@ files:
206
202
  homepage: https://github.com/pat/combustion
207
203
  licenses:
208
204
  - MIT
209
- metadata: {}
210
- post_install_message:
205
+ metadata:
206
+ rubygems_mfa_required: 'true'
207
+ post_install_message:
211
208
  rdoc_options: []
212
209
  require_paths:
213
210
  - lib
@@ -222,8 +219,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
219
  - !ruby/object:Gem::Version
223
220
  version: '0'
224
221
  requirements: []
225
- rubygems_version: 3.0.3
226
- signing_key:
222
+ rubygems_version: 3.1.6
223
+ signing_key:
227
224
  specification_version: 4
228
225
  summary: Elegant Rails Engine Testing
229
226
  test_files:
@@ -231,13 +228,9 @@ test_files:
231
228
  - spec/dummy/spec/internal/app/models/model.rb
232
229
  - spec/dummy/spec/internal/app/models/model_in_another_db.rb
233
230
  - spec/dummy/spec/internal/app/assets/config/manifest.js
234
- - spec/dummy/spec/internal/test
235
231
  - spec/dummy/spec/internal/config/routes.rb
236
232
  - spec/dummy/spec/internal/config/database.yml
237
233
  - spec/dummy/spec/internal/db/schema.rb
238
- - spec/dummy/spec/internal/log/test.log
239
- - spec/dummy/spec/internal/log/development.log
240
- - spec/dummy/spec/internal/test_another
241
234
  - spec/dummy/lib/engine.rb
242
235
  - spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
243
236
  - spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
@@ -1,52 +0,0 @@
1
-  (215.8ms) DROP DATABASE IF EXISTS "test"
2
-  (481.0ms) CREATE DATABASE "test" ENCODING = 'utf8'
3
-  (214.9ms) DROP DATABASE IF EXISTS "test_another"
4
-  (487.9ms) CREATE DATABASE "test_another" ENCODING = 'utf8'
5
-  (6.6ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
6
- ActiveRecord::InternalMetadata Load (0.8ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
7
-  (0.2ms) BEGIN
8
- SQL (0.9ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-10 01:18:56.230481"], ["updated_at", "2018-02-10 01:18:56.230481"]]
9
-  (0.4ms) COMMIT
10
-  (4.1ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
11
-  (0.2ms) SELECT pg_try_advisory_lock(7458657555131878620);
12
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
13
- Migrating to CreateDummyTestTable (20150717075542)
14
-  (0.1ms) BEGIN
15
-  (3.3ms) CREATE TABLE "dummy_table" ("id" serial NOT NULL PRIMARY KEY)
16
- SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20150717075542"]]
17
-  (0.5ms) COMMIT
18
- Migrating to CreateDummyTestTableInAnotherDb (20150717075543)
19
-  (0.3ms) BEGIN
20
-  (8.3ms) CREATE TABLE "dummy_in_another_db" ("id" serial NOT NULL PRIMARY KEY)
21
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20150717075543"]]
22
-  (0.4ms) COMMIT
23
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
24
-  (0.2ms) BEGIN
25
-  (0.3ms) COMMIT
26
-  (0.2ms) SELECT pg_advisory_unlock(7458657555131878620)
27
-  (212.2ms) DROP DATABASE IF EXISTS "test"
28
-  (456.5ms) CREATE DATABASE "test" ENCODING = 'utf8'
29
-  (195.0ms) DROP DATABASE IF EXISTS "test_another"
30
-  (476.9ms) CREATE DATABASE "test_another" ENCODING = 'utf8'
31
-  (6.7ms) CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
32
- ActiveRecord::InternalMetadata Load (0.4ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
33
-  (0.2ms) BEGIN
34
- SQL (0.5ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key" [["key", "environment"], ["value", "development"], ["created_at", "2018-02-10 01:20:13.372972"], ["updated_at", "2018-02-10 01:20:13.372972"]]
35
-  (0.5ms) COMMIT
36
-  (4.7ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
37
-  (0.2ms) SELECT pg_try_advisory_lock(7458657555131878620);
38
-  (0.5ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
39
- Migrating to CreateDummyTestTable (20150717075542)
40
-  (0.2ms) BEGIN
41
-  (3.2ms) CREATE TABLE "dummy_table" ("id" serial NOT NULL PRIMARY KEY)
42
- SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20150717075542"]]
43
-  (0.7ms) COMMIT
44
- Migrating to CreateDummyTestTableInAnotherDb (20150717075543)
45
-  (0.2ms) BEGIN
46
-  (8.1ms) CREATE TABLE "dummy_in_another_db" ("id" serial NOT NULL PRIMARY KEY)
47
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version" [["version", "20150717075543"]]
48
-  (0.4ms) COMMIT
49
- ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
50
-  (0.1ms) BEGIN
51
-  (0.1ms) COMMIT
52
-  (0.2ms) SELECT pg_advisory_unlock(7458657555131878620)