combustion 1.3.3 → 1.3.4

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: 97053abef57625a082cfc03848c5822384541e7badc99ad7eda77729eca45e11
4
- data.tar.gz: 69afc4e110cc230359c021ee0ed7820241af3bfeaeff0229c441594225c4d732
3
+ metadata.gz: 7b3fd4577536b234e2a725161ea56238351c54784104bd7a69e484a5b1f33706
4
+ data.tar.gz: e390892995d4c40a4fbf786021f7512f93c4e12a0fc1e34fdc51223aa18a0d85
5
5
  SHA512:
6
- metadata.gz: b4e662dede67e6e44ba8fc570277190e330948f2b73dd1b71067a5caee84d6171a63a54967a56246d06544c6458dbb57c0c2b28ef15401a173fe0f917b47debb
7
- data.tar.gz: 1035a1e6b7c2b8b6a4b4d4d1e7bf95838b76a9720db2f240d42abd5c8a55e0318cd54360ccf689118138155254f60fc7ded4cde6cb5437f7f132b233b24753c1
6
+ metadata.gz: d8b096fde78139237376b4495b992ea4f1ec63b07bc3974e94481f781e06e724b5a9b15bba014ed98abcf8a436a45b0f908fefb26cb62f284befe6ef7f45138c
7
+ data.tar.gz: 0cb0f385fe230abc83b7b90bbe2eb4f19725885203d0061ad36b99a35f250f4683e12412b270fe75d1fbeff2fdf9f3535f6b92fadf7308ea181caac7fe5e849a
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
@@ -3,12 +3,13 @@
3
3
  class Combustion::Configurations::ActiveRecord
4
4
  def self.call(config)
5
5
  return unless defined?(ActiveRecord::Railtie)
6
- return unless ::ActiveRecord.constants.include?(:MassAssignmentSecurity)
7
6
 
8
7
  if ActiveRecord::VERSION::MAJOR >= 7
9
8
  config.active_record.legacy_connection_handling = false
10
9
  end
11
10
 
11
+ return unless ::ActiveRecord.constants.include?(:MassAssignmentSecurity)
12
+
12
13
  # Turn on ActiveRecord attribute whitelisting
13
14
  # This way the dummy app matches new rails apps re: this setting
14
15
  config.active_record.whitelist_attributes = true
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(:active_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
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.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -202,7 +202,8 @@ files:
202
202
  homepage: https://github.com/pat/combustion
203
203
  licenses:
204
204
  - MIT
205
- metadata: {}
205
+ metadata:
206
+ rubygems_mfa_required: 'true'
206
207
  post_install_message:
207
208
  rdoc_options: []
208
209
  require_paths:
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
219
  - !ruby/object:Gem::Version
219
220
  version: '0'
220
221
  requirements: []
221
- rubygems_version: 3.1.4
222
+ rubygems_version: 3.1.6
222
223
  signing_key:
223
224
  specification_version: 4
224
225
  summary: Elegant Rails Engine Testing