combustion 1.1.2 → 1.2.0

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: 3eb6d2a6b0969112f3503bab5f3b9c4847118d4a7e109651cf1ac616de7d419b
4
- data.tar.gz: 3d8ae68beb0394aec13846aafa2f20b4c195403e07a727106a61a1098ce3cc99
3
+ metadata.gz: d75fdd951c2753bc78da33f55e44da984f70f8ef688c09f350d672d4dd5cd6bc
4
+ data.tar.gz: 94a09faad89e5c0f14b2e696862cf9a13d72c06cf645287303bdcd3758c7a42e
5
5
  SHA512:
6
- metadata.gz: e814d51e52656bc048850758136196e8f93bcb164e131773cf5d36c291a5568482550e1c9899d263d5d0a21e5f73cd523537db4114598f753885a275542623fe
7
- data.tar.gz: c16a93e9c6130109c94a7b0324f4350eb96f6041512f419fac6666b0816ed11b1431c68efa20df803c0193ed820b8dd849f46bff767843f2d27fb8abc256e03b
6
+ metadata.gz: 27ab0c66fbf63e48f67acf75af81b29dda40bd8307633675097fc344521d52dbcbcc6e93695315272a5b9023c948743cff78f6f134084a2fc49e4565e2307a8c
7
+ data.tar.gz: 435840a9905a72fd0883499400a7b4abecb288c3d1d4c5f66da9a4280a4a440159e2634089a76de7c47dab2edd4a16152a1f4adb4c2716789d1b6b2385456157
@@ -1,9 +1,6 @@
1
1
  inherit_from:
2
2
  - https://gist.githubusercontent.com/pat/ba3b8ffb1901bfe5439b460943b6b019/raw/.rubocop.yml
3
3
 
4
- AllCops:
5
- TargetRubyVersion: 2.2
6
-
7
4
  Bundler/OrderedGems:
8
5
  Exclude:
9
6
  - 'gemfiles/*'
@@ -17,7 +14,7 @@ Layout/CaseIndentation:
17
14
  Layout/EndAlignment:
18
15
  EnforcedStyleAlignWith: variable
19
16
 
20
- Layout/IndentHeredoc:
17
+ Layout/HeredocIndentation:
21
18
  Enabled: false
22
19
 
23
20
  Metrics/BlockLength:
@@ -6,11 +6,11 @@ env:
6
6
  - "DB_ADAPTER=postgresql"
7
7
  - "DB_ADAPTER=mysql2"
8
8
  rvm:
9
- - 2.2.10
10
9
  - 2.3.8
11
- - 2.4.6
12
- - 2.5.5
13
- - 2.6.3
10
+ - 2.4.10
11
+ - 2.5.8
12
+ - 2.6.6
13
+ - 2.7.1
14
14
  before_install:
15
15
  - gem install bundler --version "~> 1.17"
16
16
  install:
data/HISTORY CHANGED
@@ -1,3 +1,6 @@
1
+ 1.2.0 - April 18th 2020
2
+ * Support ActiveStorage (Mikko Kokkonen).
3
+
1
4
  1.1.2 - November 4th 2019
2
5
  * Generate an empty asset manifest file for Rails 6.
3
6
 
data/README.md CHANGED
@@ -10,10 +10,10 @@ Get the gem into either your gemspec or your Gemfile, depending on how you manag
10
10
 
11
11
  ```ruby
12
12
  # gemspec
13
- gem.add_development_dependency 'combustion', '~> 1.1'
13
+ gem.add_development_dependency 'combustion', '~> 1.2'
14
14
 
15
15
  # Gemfile
16
- gem 'combustion', '~> 1.1'
16
+ gem 'combustion', '~> 1.2'
17
17
  ```
18
18
 
19
19
  In your `spec_helper.rb`, get Combustion to set itself up - which has to happen before you introduce `rspec/rails` and - if being used - `capybara/rails`. Here's an example within context:
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "combustion"
5
- s.version = "1.1.2"
5
+ s.version = "1.2.0"
6
6
  s.authors = ["Pat Allan"]
7
7
  s.email = ["pat@freelancing-gods.com"]
8
8
  s.homepage = "https://github.com/pat/combustion"
@@ -27,6 +27,6 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency "pg"
28
28
  s.add_development_dependency "rails"
29
29
  s.add_development_dependency "rspec"
30
- s.add_development_dependency "rubocop", "~> 0.68.0"
30
+ s.add_development_dependency "rubocop", "~> 0.81"
31
31
  s.add_development_dependency "sqlite3"
32
32
  end
@@ -12,18 +12,27 @@ module Combustion
12
12
  self.path = "/spec/internal"
13
13
  self.schema_format = :ruby
14
14
 
15
- MODULES = if Rails.version.to_f >= 3.1
16
- %w[ active_record action_controller action_view action_mailer sprockets ]
17
- else
18
- %w[ active_record action_controller action_view action_mailer ]
19
- end
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_storage] = "active_storage/engine" if Rails.version.to_f >= 5.2
26
+
27
+ hash
28
+ end.freeze
20
29
 
21
30
  def self.initialize!(*modules, &block)
22
31
  self.setup_environment = block if block_given?
23
32
 
24
33
  options = modules.extract_options!
25
- modules = MODULES if modules == [:all]
26
- modules.each { |mod| require "#{mod}/railtie" }
34
+ modules = MODULES.keys if modules == [:all]
35
+ modules.each { |mod| require MODULES[mod] }
27
36
 
28
37
  Bundler.require :default, Rails.env
29
38
 
@@ -65,8 +74,9 @@ module Combustion
65
74
  end
66
75
  end
67
76
 
68
- require "combustion/application"
69
77
  require "combustion/configurations/action_controller"
70
78
  require "combustion/configurations/action_mailer"
71
79
  require "combustion/configurations/active_record"
80
+ require "combustion/configurations/active_storage"
81
+ require "combustion/application"
72
82
  require "combustion/database"
@@ -6,6 +6,13 @@ Rails.env = ENV["RAILS_ENV"] || "test"
6
6
 
7
7
  module Combustion
8
8
  class Application < Rails::Application
9
+ CONFIGURERS = [
10
+ Combustion::Configurations::ActiveRecord,
11
+ Combustion::Configurations::ActionController,
12
+ Combustion::Configurations::ActionMailer,
13
+ Combustion::Configurations::ActiveStorage
14
+ ].freeze
15
+
9
16
  version = Rails.version.to_f
10
17
 
11
18
  # Core Settings
@@ -26,9 +33,7 @@ module Combustion
26
33
  def self.configure_for_combustion
27
34
  config.root = File.expand_path File.join(Dir.pwd, Combustion.path)
28
35
 
29
- Combustion::Configurations::ActiveRecord.call config
30
- Combustion::Configurations::ActionController.call config
31
- Combustion::Configurations::ActionMailer.call config
36
+ CONFIGURERS.each { |configurer| configurer.call config }
32
37
 
33
38
  config.assets.enabled = true if defined?(Sprockets)
34
39
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Combustion::Configurations::ActiveStorage
4
+ def self.call(config)
5
+ return unless defined?(ActiveStorage::Engine)
6
+
7
+ config.active_storage.service = :test
8
+ end
9
+ end
@@ -23,6 +23,7 @@ module Combustion
23
23
  template "templates/database.yml", "spec/internal/config/database.yml"
24
24
  template "templates/schema.rb", "spec/internal/db/schema.rb"
25
25
  template "templates/config.ru", "config.ru"
26
+ template "templates/storage.yml", "spec/internal/config/storage.yml"
26
27
 
27
28
  create_file "spec/internal/app/assets/config/manifest.js"
28
29
  create_file "spec/internal/public/favicon.ico"
@@ -1,32 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Combustion
4
- describe Database do
5
- before(:all) do
6
- Dir.chdir(File.expand_path("dummy", __dir__)) do
7
- Combustion.initialize! :active_record
8
- end
9
- end
10
-
11
- it "creates dummy table from migration in base database" do
12
- expect(Model.connection.table_exists?("dummy_table")).to eq true
13
- expect(Model.connection.table_exists?("dummy_in_another_db")).to eq false
14
- end
3
+ RSpec.describe Combustion::Database do
4
+ it "creates dummy table from migration in base database" do
5
+ expect(Model.connection.table_exists?("dummy_table")).to eq true
6
+ expect(Model.connection.table_exists?("dummy_in_another_db")).to eq false
7
+ end
15
8
 
16
- it "creates another dummy table from another database" do
17
- expect(ModelInAnotherDb.connection.table_exists?("dummy_table")).
18
- to eq false
19
- expect(ModelInAnotherDb.connection.table_exists?("dummy_in_another_db")).
20
- to eq true
21
- end
9
+ it "creates another dummy table from another database" do
10
+ expect(ModelInAnotherDb.connection.table_exists?("dummy_table")).
11
+ to eq false
12
+ expect(ModelInAnotherDb.connection.table_exists?("dummy_in_another_db")).
13
+ to eq true
14
+ end
22
15
 
23
- it "returns test database for model with default connection" do
24
- expect(Model.connection_config[:database]).to match(/test/)
25
- end
16
+ it "returns test database for model with default connection" do
17
+ expect(Model.connection_config[:database]).to match(/test/)
18
+ end
26
19
 
27
- it "returns test_another for model with connection to second database" do
28
- expect(ModelInAnotherDb.connection_config[:database]).
29
- to match(/test_another/)
30
- end
20
+ it "returns test_another for model with connection to second database" do
21
+ expect(ModelInAnotherDb.connection_config[:database]).
22
+ to match(/test_another/)
31
23
  end
32
24
  end
@@ -13,3 +13,7 @@ if Rails::VERSION::STRING.to_f < 4.1
13
13
  end
14
14
 
15
15
  require File.expand_path("dummy/lib/engine.rb", __dir__)
16
+
17
+ Dir.chdir(File.expand_path("dummy", __dir__)) do
18
+ Combustion.initialize! :all
19
+ end
@@ -0,0 +1,3 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
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.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-04 00:00:00.000000000 Z
11
+ date: 2020-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.68.0
131
+ version: '0.81'
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.68.0
138
+ version: '0.81'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sqlite3
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +175,7 @@ files:
175
175
  - lib/combustion/configurations/action_controller.rb
176
176
  - lib/combustion/configurations/action_mailer.rb
177
177
  - lib/combustion/configurations/active_record.rb
178
+ - lib/combustion/configurations/active_storage.rb
178
179
  - lib/combustion/database.rb
179
180
  - lib/combustion/database/load_schema.rb
180
181
  - lib/combustion/database/migrate.rb
@@ -191,6 +192,7 @@ files:
191
192
  - spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
192
193
  - spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
193
194
  - spec/dummy/lib/engine.rb
195
+ - spec/dummy/spec/internal/app/assets/config/manifest.js
194
196
  - spec/dummy/spec/internal/app/models/model.rb
195
197
  - spec/dummy/spec/internal/app/models/model_in_another_db.rb
196
198
  - spec/dummy/spec/internal/config/database.yml
@@ -202,6 +204,7 @@ files:
202
204
  - templates/database.yml
203
205
  - templates/routes.rb
204
206
  - templates/schema.rb
207
+ - templates/storage.yml
205
208
  homepage: https://github.com/pat/combustion
206
209
  licenses:
207
210
  - MIT
@@ -221,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
224
  - !ruby/object:Gem::Version
222
225
  version: '0'
223
226
  requirements: []
224
- rubygems_version: 3.0.4
227
+ rubygems_version: 3.1.2
225
228
  signing_key:
226
229
  specification_version: 4
227
230
  summary: Elegant Rails Engine Testing
@@ -230,6 +233,7 @@ test_files:
230
233
  - spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
231
234
  - spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
232
235
  - spec/dummy/lib/engine.rb
236
+ - spec/dummy/spec/internal/app/assets/config/manifest.js
233
237
  - spec/dummy/spec/internal/app/models/model.rb
234
238
  - spec/dummy/spec/internal/app/models/model_in_another_db.rb
235
239
  - spec/dummy/spec/internal/config/database.yml