combustion 1.1.2 → 1.2.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/.rubocop.yml +1 -4
- data/.travis.yml +4 -4
- data/HISTORY +3 -0
- data/README.md +2 -2
- data/combustion.gemspec +2 -2
- data/lib/combustion.rb +18 -8
- data/lib/combustion/application.rb +8 -3
- data/lib/combustion/configurations/active_storage.rb +9 -0
- data/lib/combustion/generator.rb +1 -0
- data/spec/database_spec.rb +17 -25
- data/spec/dummy/spec/internal/app/assets/config/manifest.js +1 -0
- data/spec/spec_helper.rb +4 -0
- data/templates/storage.yml +3 -0
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d75fdd951c2753bc78da33f55e44da984f70f8ef688c09f350d672d4dd5cd6bc
|
4
|
+
data.tar.gz: 94a09faad89e5c0f14b2e696862cf9a13d72c06cf645287303bdcd3758c7a42e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27ab0c66fbf63e48f67acf75af81b29dda40bd8307633675097fc344521d52dbcbcc6e93695315272a5b9023c948743cff78f6f134084a2fc49e4565e2307a8c
|
7
|
+
data.tar.gz: 435840a9905a72fd0883499400a7b4abecb288c3d1d4c5f66da9a4280a4a440159e2634089a76de7c47dab2edd4a16152a1f4adb4c2716789d1b6b2385456157
|
data/.rubocop.yml
CHANGED
@@ -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/
|
17
|
+
Layout/HeredocIndentation:
|
21
18
|
Enabled: false
|
22
19
|
|
23
20
|
Metrics/BlockLength:
|
data/.travis.yml
CHANGED
data/HISTORY
CHANGED
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.
|
13
|
+
gem.add_development_dependency 'combustion', '~> 1.2'
|
14
14
|
|
15
15
|
# Gemfile
|
16
|
-
gem 'combustion', '~> 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:
|
data/combustion.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "combustion"
|
5
|
-
s.version = "1.
|
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.
|
30
|
+
s.add_development_dependency "rubocop", "~> 0.81"
|
31
31
|
s.add_development_dependency "sqlite3"
|
32
32
|
end
|
data/lib/combustion.rb
CHANGED
@@ -12,18 +12,27 @@ module Combustion
|
|
12
12
|
self.path = "/spec/internal"
|
13
13
|
self.schema_format = :ruby
|
14
14
|
|
15
|
-
MODULES =
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
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
|
-
|
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
|
data/lib/combustion/generator.rb
CHANGED
@@ -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"
|
data/spec/database_spec.rb
CHANGED
@@ -1,32 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
//
|
data/spec/spec_helper.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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.
|
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
|