combustion 1.0.0 → 1.5.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/Appraisals +44 -31
- data/Gemfile +12 -0
- data/README.md +8 -6
- data/lib/combustion/application.rb +22 -7
- data/lib/combustion/configurations/active_record.rb +5 -0
- data/lib/combustion/configurations/active_storage.rb +9 -0
- data/lib/combustion/database/migrate.rb +11 -3
- data/lib/combustion/database/reset.rb +38 -12
- data/lib/combustion/databases/mysql.rb +17 -15
- data/lib/combustion/databases/postgresql.rb +13 -8
- data/lib/combustion/databases/sql_server.rb +2 -2
- data/lib/combustion/databases/sqlite.rb +2 -2
- data/lib/combustion/generator.rb +5 -2
- data/lib/combustion/version_gate.rb +35 -0
- data/lib/combustion.rb +33 -8
- data/spec/database_spec.rb +22 -21
- data/spec/dummy/spec/internal/app/assets/config/manifest.js +1 -0
- data/spec/dummy/spec/internal/combustion +0 -0
- data/spec/dummy/spec/internal/config/database.yml +9 -1
- data/spec/spec_helper.rb +5 -2
- data/templates/storage.yml +3 -0
- metadata +23 -28
- data/.gitignore +0 -11
- data/.rubocop.yml +0 -39
- data/.travis.yml +0 -20
- data/HISTORY +0 -96
- data/combustion.gemspec +0 -34
- data/gemfiles/rails_3.1.gemfile +0 -9
- data/gemfiles/rails_3.2.gemfile +0 -9
- data/gemfiles/rails_4.0.gemfile +0 -9
- data/gemfiles/rails_4.1.gemfile +0 -9
- data/gemfiles/rails_4.2.gemfile +0 -9
- data/gemfiles/rails_5.0.gemfile +0 -9
- data/gemfiles/rails_5.1.gemfile +0 -9
- data/gemfiles/rails_5.2.gemfile +0 -8
- data/gemfiles/rails_5_0.gemfile +0 -7
- data/spec/dummy/spec/internal/log/.gitignore +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 022c30e0d3b5dd020d5765951897e91fd4d33725c87b54ce0370e2fdcaea67c8
|
|
4
|
+
data.tar.gz: 5f53fd6cef1a7c7c92f9618d37b852d446d565edc3019a2cd0a96f244c08c2e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bacc58fd39c3708d26623631bb021f0a8c912e64ea9733cc6426dddeba9861e0a1af8fa75f7de18ebd6b3d567a873460d633976e263ce7f500c2224831546eb
|
|
7
|
+
data.tar.gz: de2cfdd55a3169eb14c89f3db2090f12b6df84dbeed539b13627c20eb7b696ff1ebef2be6b76c7bdbe2b4e609d2c6a727eabec142e9e9020859e34a91dd979d6
|
data/Appraisals
CHANGED
|
@@ -1,50 +1,63 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
if RUBY_VERSION.to_f
|
|
4
|
-
appraise "rails-
|
|
5
|
-
gem "rails", "~>
|
|
6
|
-
gem "mysql2", "~> 0.
|
|
3
|
+
if RUBY_VERSION.to_f < 3.0
|
|
4
|
+
appraise "rails-5.0" do
|
|
5
|
+
gem "rails", "~> 5.0.2"
|
|
6
|
+
gem "mysql2", "~> 0.4.4"
|
|
7
7
|
gem "pg", "< 1.0"
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
appraise "rails-
|
|
11
|
-
gem "rails", "~>
|
|
12
|
-
gem "mysql2", "~> 0.
|
|
10
|
+
appraise "rails-5.1" do
|
|
11
|
+
gem "rails", "~> 5.1.0"
|
|
12
|
+
gem "mysql2", "~> 0.4.4"
|
|
13
13
|
gem "pg", "< 1.0"
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
appraise "rails-
|
|
17
|
-
gem "rails", "~>
|
|
18
|
-
gem "mysql2", "~> 0.
|
|
19
|
-
gem "pg", "< 1.0"
|
|
16
|
+
appraise "rails-5.2" do
|
|
17
|
+
gem "rails", "~> 5.2.0"
|
|
18
|
+
gem "mysql2", "~> 0.5.0"
|
|
20
19
|
end
|
|
20
|
+
end
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
gem "
|
|
25
|
-
gem "
|
|
22
|
+
if RUBY_VERSION.to_f >= 2.5 && RUBY_VERSION.to_f < 3.1
|
|
23
|
+
appraise "rails-6.0" do
|
|
24
|
+
gem "rails", "~> 6.0.0"
|
|
25
|
+
gem "mysql2", "~> 0.5.0"
|
|
26
|
+
gem "sqlite3", "~> 1.4", "< 1.5.0"
|
|
27
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
26
28
|
end
|
|
29
|
+
end
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
gem "
|
|
31
|
-
gem "
|
|
31
|
+
if RUBY_VERSION.to_f >= 2.5
|
|
32
|
+
appraise "rails-6.1" do
|
|
33
|
+
gem "rails", "~> 6.1.0"
|
|
34
|
+
gem "mysql2", "~> 0.5.0"
|
|
35
|
+
gem "sqlite3", "~> 1.4", "< 1.6.0"
|
|
36
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
32
37
|
end
|
|
33
38
|
end
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
if RUBY_VERSION.to_f >= 2.7
|
|
41
|
+
appraise "rails-7.0" do
|
|
42
|
+
gem "rails", "~> 7.0.1"
|
|
43
|
+
gem "mysql2", "~> 0.5.0"
|
|
44
|
+
gem "sqlite3", "~> 1.4"
|
|
45
|
+
gem "activerecord-trilogy-adapter", "~> 3.1"
|
|
46
|
+
end
|
|
40
47
|
|
|
41
|
-
appraise "rails-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
appraise "rails-7.1" do
|
|
49
|
+
gem "rails", "~> 7.1.2"
|
|
50
|
+
gem "mysql2", "~> 0.5.0"
|
|
51
|
+
gem "sqlite3", "~> 1.4"
|
|
52
|
+
gem "trilogy", "~> 2.7"
|
|
53
|
+
end
|
|
45
54
|
end
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
if RUBY_VERSION.to_f >= 3.1
|
|
57
|
+
appraise "rails-edge" do
|
|
58
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "main"
|
|
59
|
+
gem "mysql2", "~> 0.5.0"
|
|
60
|
+
gem "sqlite3", "~> 1.4"
|
|
61
|
+
gem "trilogy", "~> 2.7"
|
|
62
|
+
end
|
|
50
63
|
end
|
data/Gemfile
CHANGED
|
@@ -3,3 +3,15 @@
|
|
|
3
3
|
source "http://rubygems.org"
|
|
4
4
|
|
|
5
5
|
gemspec
|
|
6
|
+
|
|
7
|
+
if RUBY_VERSION.to_f < 3.0
|
|
8
|
+
gem "sqlite3", "~> 1.3.13"
|
|
9
|
+
else
|
|
10
|
+
gem "sqlite3", "~> 1.4"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
gem "rubocop", "~> 0.92"
|
|
14
|
+
gem "rubocop-packaging", "~> 0.5"
|
|
15
|
+
|
|
16
|
+
# Required for testing Rails 6.1 on MRI 3.1+
|
|
17
|
+
gem "net-smtp" if RUBY_VERSION.to_f > 3.0
|
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.3'
|
|
14
14
|
|
|
15
15
|
# Gemfile
|
|
16
|
-
gem 'combustion', '~> 1.
|
|
16
|
+
gem 'combustion', '~> 1.3'
|
|
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:
|
|
@@ -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
|
|
@@ -150,13 +152,13 @@ Combustion.initialize! :all do
|
|
|
150
152
|
end
|
|
151
153
|
```
|
|
152
154
|
|
|
153
|
-
Values given through the initialize! block will be set during Rails initialization
|
|
155
|
+
Values given through the initialize! block will be set during Rails initialization process, exactly before the corresponding environment file inside `spec/internals/config/enviroments` is loaded (when that file exists), overriding Combustion's defaults.
|
|
154
156
|
|
|
155
157
|
Parameters defined in, for instance, `spec/internals/config/environments/test.rb`, would override Combustion's defaults and also config settings passed to initialize!.
|
|
156
158
|
|
|
157
159
|
### Using other Rails-focused libraries
|
|
158
160
|
|
|
159
|
-
Be aware that other gems may require parts of Rails when they're loaded, and this could cause some issues with Combustion's own setup. You may need to manage the loading yourself by setting `:require` to false in your Gemfile for the gem in question, and then requiring it manually in your spec_helper. View [issue #33](https://github.com/pat/combustion/issues/33) for an example with
|
|
161
|
+
Be aware that other gems may require parts of Rails when they're loaded, and this could cause some issues with Combustion's own setup. You may need to manage the loading yourself by setting `:require` to false in your Gemfile for the gem in question, and then requiring it manually in your spec_helper. View [issue #33](https://github.com/pat/combustion/issues/33) for an example with FactoryBot.
|
|
160
162
|
|
|
161
163
|
### Environment and Logging
|
|
162
164
|
|
|
@@ -185,7 +187,7 @@ end
|
|
|
185
187
|
|
|
186
188
|
## Compatibility
|
|
187
189
|
|
|
188
|
-
The current test matrix covers MRI 2.
|
|
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.
|
|
189
191
|
|
|
190
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.
|
|
191
193
|
|
|
@@ -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-
|
|
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).
|
|
@@ -6,16 +6,32 @@ Rails.env = ENV["RAILS_ENV"] || "test"
|
|
|
6
6
|
|
|
7
7
|
module Combustion
|
|
8
8
|
class Application < Rails::Application
|
|
9
|
-
|
|
9
|
+
CONFIGURERS = [
|
|
10
|
+
Combustion::Configurations::ActiveRecord,
|
|
11
|
+
Combustion::Configurations::ActionController,
|
|
12
|
+
Combustion::Configurations::ActionMailer,
|
|
13
|
+
Combustion::Configurations::ActiveStorage
|
|
14
|
+
].freeze
|
|
15
|
+
|
|
16
|
+
rails_gate = VersionGate.new("railties")
|
|
17
|
+
|
|
18
|
+
if rails_gate.call(">= 7.2.0.alpha")
|
|
19
|
+
config.load_defaults Rails::VERSION::STRING.to_f
|
|
20
|
+
end
|
|
10
21
|
|
|
11
22
|
# Core Settings
|
|
12
23
|
config.cache_classes = true
|
|
13
24
|
config.consider_all_requests_local = true
|
|
14
25
|
config.eager_load = Rails.env.production?
|
|
15
26
|
|
|
16
|
-
config.secret_key_base = SecureRandom.hex if
|
|
17
|
-
config.whiny_nils = true if
|
|
18
|
-
|
|
27
|
+
config.secret_key_base = SecureRandom.hex if rails_gate.call(">= 4.0")
|
|
28
|
+
config.whiny_nils = true if rails_gate.call("< 4")
|
|
29
|
+
if rails_gate.call("< 5.2")
|
|
30
|
+
config.secret_token = Digest::SHA1.hexdigest Time.now.to_s
|
|
31
|
+
end
|
|
32
|
+
if rails_gate.call("~> 7.1.0.alpha")
|
|
33
|
+
config.active_support.cache_format_version = 7.1
|
|
34
|
+
end
|
|
19
35
|
|
|
20
36
|
# ActiveSupport Settings
|
|
21
37
|
config.active_support.deprecation = :stderr
|
|
@@ -26,9 +42,7 @@ module Combustion
|
|
|
26
42
|
def self.configure_for_combustion
|
|
27
43
|
config.root = File.expand_path File.join(Dir.pwd, Combustion.path)
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
Combustion::Configurations::ActionController.call config
|
|
31
|
-
Combustion::Configurations::ActionMailer.call config
|
|
45
|
+
CONFIGURERS.each { |configurer| configurer.call config }
|
|
32
46
|
|
|
33
47
|
config.assets.enabled = true if defined?(Sprockets)
|
|
34
48
|
end
|
|
@@ -39,6 +53,7 @@ module Combustion
|
|
|
39
53
|
:group => :all
|
|
40
54
|
) do
|
|
41
55
|
next unless Combustion.setup_environment
|
|
56
|
+
|
|
42
57
|
Combustion::Application.class_eval(&Combustion.setup_environment)
|
|
43
58
|
end
|
|
44
59
|
end
|
|
@@ -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 Combustion::VersionGate.call("activerecord", "~> 7.0.0")
|
|
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
|
|
@@ -6,9 +6,11 @@ class Combustion::Database::Migrate
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def call
|
|
9
|
-
|
|
9
|
+
ar_gate = Combustion::VersionGate.new("activerecord")
|
|
10
|
+
|
|
11
|
+
if ar_gate.call(">= 5.2")
|
|
10
12
|
migration_context.migrate
|
|
11
|
-
elsif
|
|
13
|
+
elsif ar_gate.call(">= 3.1")
|
|
12
14
|
migrator.migrate paths, nil
|
|
13
15
|
else
|
|
14
16
|
paths.each { |path| migrator.migrate path, nil }
|
|
@@ -44,7 +46,13 @@ class Combustion::Database::Migrate
|
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
def migration_context
|
|
47
|
-
ActiveRecord::MigrationContext.
|
|
49
|
+
if ActiveRecord::MigrationContext.instance_method(:initialize).arity <= 1
|
|
50
|
+
ActiveRecord::MigrationContext.new paths
|
|
51
|
+
else
|
|
52
|
+
ActiveRecord::MigrationContext.new(
|
|
53
|
+
paths, ActiveRecord::Base.connection.schema_migration
|
|
54
|
+
)
|
|
55
|
+
end
|
|
48
56
|
end
|
|
49
57
|
|
|
50
58
|
def migrator
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class Combustion::Database::Reset
|
|
4
|
+
# https://github.com/ruby/psych/pull/358/files#diff-fcdbfb11714f576f58ba9f866052bc79R322
|
|
5
|
+
RUBY_VERSION_WITH_NEW_SAFE_LOAD_METHOD_SIGNATURE = "2.6.0"
|
|
6
|
+
|
|
4
7
|
UnsupportedDatabase = Class.new StandardError
|
|
5
8
|
|
|
6
9
|
OPERATOR_PATTERNS = {
|
|
7
|
-
Combustion::Databases::MySQL
|
|
10
|
+
Combustion::Databases::MySQL => [/mysql/, /trilogy/],
|
|
8
11
|
Combustion::Databases::PostgreSQL => [/postgres/, /postgis/],
|
|
9
12
|
Combustion::Databases::SQLite => [/sqlite/],
|
|
10
13
|
Combustion::Databases::SQLServer => [/sqlserver/],
|
|
@@ -19,15 +22,22 @@ class Combustion::Database::Reset
|
|
|
19
22
|
end
|
|
20
23
|
|
|
21
24
|
def initialize
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
# TODO: remove when no longer support 2.5.8
|
|
26
|
+
if RUBY_VERSION >= RUBY_VERSION_WITH_NEW_SAFE_LOAD_METHOD_SIGNATURE
|
|
27
|
+
ActiveRecord::Base.configurations = YAML.safe_load(
|
|
28
|
+
ERB.new(database_yaml).result, :aliases => true
|
|
29
|
+
)
|
|
30
|
+
else
|
|
31
|
+
ActiveRecord::Base.configurations = YAML.safe_load(
|
|
32
|
+
ERB.new(database_yaml).result, [], [], true
|
|
33
|
+
)
|
|
34
|
+
end
|
|
25
35
|
end
|
|
26
36
|
|
|
27
37
|
def call
|
|
28
|
-
resettable_db_configs.
|
|
29
|
-
adapter = configuration[
|
|
30
|
-
configuration[
|
|
38
|
+
resettable_db_configs.each do |configuration|
|
|
39
|
+
adapter = configuration[:adapter] ||
|
|
40
|
+
configuration[:url].split("://").first
|
|
31
41
|
|
|
32
42
|
operator_class(adapter).new(configuration).reset
|
|
33
43
|
end
|
|
@@ -52,12 +62,28 @@ class Combustion::Database::Reset
|
|
|
52
62
|
# All database configs except Rails default environments
|
|
53
63
|
# that are not currently in use
|
|
54
64
|
def resettable_db_configs
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
if Combustion::VersionGate.call("activerecord", ">= 6.1")
|
|
66
|
+
return resettable_db_configs_for_6_1
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
all_configurations = ActiveRecord::Base.configurations.to_h
|
|
70
|
+
unused_environments = RAILS_DEFAULT_ENVIRONMENTS - [Rails.env.to_s]
|
|
71
|
+
resettable_environments = all_configurations.keys - unused_environments
|
|
72
|
+
|
|
73
|
+
all_configurations.
|
|
74
|
+
select { |name| resettable_environments.include?(name) }.
|
|
75
|
+
values.
|
|
76
|
+
collect(&:with_indifferent_access)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def resettable_db_configs_for_6_1
|
|
80
|
+
all_configurations = ActiveRecord::Base.configurations.configurations
|
|
81
|
+
unused_environments = RAILS_DEFAULT_ENVIRONMENTS - [Rails.env.to_s]
|
|
82
|
+
resettable_environments = all_configurations.collect(&:env_name).uniq -
|
|
57
83
|
unused_environments
|
|
58
84
|
|
|
59
|
-
|
|
60
|
-
resettable_environments.include?(
|
|
61
|
-
|
|
85
|
+
all_configurations.
|
|
86
|
+
select { |config| resettable_environments.include?(config.env_name) }.
|
|
87
|
+
collect(&:configuration_hash)
|
|
62
88
|
end
|
|
63
89
|
end
|
|
@@ -4,7 +4,7 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
4
4
|
ACCESS_DENIED_ERROR = 10_145
|
|
5
5
|
|
|
6
6
|
def reset
|
|
7
|
-
establish_connection(configuration.merge(
|
|
7
|
+
establish_connection(configuration.merge(:database => nil))
|
|
8
8
|
|
|
9
9
|
super
|
|
10
10
|
end
|
|
@@ -12,21 +12,21 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
12
12
|
private
|
|
13
13
|
|
|
14
14
|
def charset
|
|
15
|
-
configuration[
|
|
15
|
+
configuration[:charset] || ENV["CHARSET"] || "utf8"
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def charset_error
|
|
19
|
-
return "" unless
|
|
19
|
+
return "" unless configuration[:charset]
|
|
20
20
|
|
|
21
21
|
"(if you set the charset manually, make sure you have a matching collation)"
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def collation
|
|
25
|
-
configuration[
|
|
25
|
+
configuration[:collation] || ENV["COLLATION"] || "utf8_unicode_ci"
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def create
|
|
29
|
-
connection.create_database configuration[
|
|
29
|
+
connection.create_database configuration[:database], creation_options
|
|
30
30
|
establish_connection configuration
|
|
31
31
|
rescue error_class => error
|
|
32
32
|
rescue_create_from error
|
|
@@ -34,12 +34,12 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
34
34
|
|
|
35
35
|
def create_as_root(error)
|
|
36
36
|
establish_connection configuration.merge(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
:database => nil,
|
|
38
|
+
:username => "root",
|
|
39
|
+
:password => request_password(error)
|
|
40
40
|
)
|
|
41
41
|
|
|
42
|
-
connection.create_database
|
|
42
|
+
connection.create_database configuration[:database], creation_options
|
|
43
43
|
connection.execute grant_statement
|
|
44
44
|
|
|
45
45
|
establish_connection configuration
|
|
@@ -50,16 +50,18 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def drop
|
|
53
|
-
connection.drop_database configuration[
|
|
53
|
+
connection.drop_database configuration[:database]
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def error_class
|
|
57
|
-
if configuration[
|
|
57
|
+
if configuration[:adapter][/jdbc/]
|
|
58
58
|
# FIXME: After Jdbcmysql gives this class
|
|
59
59
|
require "active_record/railties/jdbcmysql_error"
|
|
60
60
|
ArJdbcMySQL::Error
|
|
61
|
-
elsif
|
|
61
|
+
elsif configuration[:adapter][/mysql2/] && defined?(Mysql2)
|
|
62
62
|
Mysql2::Error
|
|
63
|
+
elsif configuration[:adapter][/trilogy/] && defined?(Trilogy)
|
|
64
|
+
Trilogy::Error
|
|
63
65
|
else
|
|
64
66
|
Mysql::Error
|
|
65
67
|
end
|
|
@@ -68,8 +70,8 @@ class Combustion::Databases::MySQL < Combustion::Databases::Base
|
|
|
68
70
|
def grant_statement
|
|
69
71
|
<<-SQL
|
|
70
72
|
GRANT ALL PRIVILEGES ON #{configuration["database"]}.*
|
|
71
|
-
TO '#{configuration[
|
|
72
|
-
IDENTIFIED BY '#{configuration[
|
|
73
|
+
TO '#{configuration[:username]}'@'localhost'
|
|
74
|
+
IDENTIFIED BY '#{configuration[:password]}' WITH GRANT OPTION;
|
|
73
75
|
SQL
|
|
74
76
|
end
|
|
75
77
|
|
|
@@ -91,7 +93,7 @@ Please provide the root password for your mysql installation
|
|
|
91
93
|
|
|
92
94
|
warn <<-TXT
|
|
93
95
|
#{error.error}
|
|
94
|
-
Couldn't create database for #{
|
|
96
|
+
Couldn't create database for #{configuration.inspect}, charset: #{charset}, collation: #{collation}
|
|
95
97
|
#{charset_error}
|
|
96
98
|
TXT
|
|
97
99
|
end
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
class Combustion::Databases::PostgreSQL < Combustion::Databases::Base
|
|
4
4
|
def reset
|
|
5
|
-
|
|
5
|
+
if Combustion::VersionGate.call("activerecord", ">= 7.1.0.alpha")
|
|
6
|
+
base.connection_handler.clear_active_connections!
|
|
7
|
+
else
|
|
8
|
+
base.clear_active_connections!
|
|
9
|
+
end
|
|
10
|
+
|
|
6
11
|
establish_connection(postgres_configuration)
|
|
7
12
|
|
|
8
13
|
super
|
|
@@ -12,8 +17,8 @@ class Combustion::Databases::PostgreSQL < Combustion::Databases::Base
|
|
|
12
17
|
|
|
13
18
|
def create
|
|
14
19
|
connection.create_database(
|
|
15
|
-
configuration[
|
|
16
|
-
configuration.merge(
|
|
20
|
+
configuration[:database],
|
|
21
|
+
configuration.merge(:encoding => encoding)
|
|
17
22
|
)
|
|
18
23
|
rescue StandardError => error
|
|
19
24
|
warn error, *error.backtrace
|
|
@@ -21,21 +26,21 @@ class Combustion::Databases::PostgreSQL < Combustion::Databases::Base
|
|
|
21
26
|
end
|
|
22
27
|
|
|
23
28
|
def drop
|
|
24
|
-
connection.drop_database(configuration[
|
|
29
|
+
connection.drop_database(configuration[:database])
|
|
25
30
|
end
|
|
26
31
|
|
|
27
32
|
def encoding
|
|
28
|
-
configuration[
|
|
33
|
+
configuration[:encoding] || ENV["CHARSET"] || "utf8"
|
|
29
34
|
end
|
|
30
35
|
|
|
31
36
|
def postgres_configuration
|
|
32
37
|
configuration.merge(
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
:database => "postgres",
|
|
39
|
+
:schema_search_path => schema_search_path
|
|
35
40
|
)
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
def schema_search_path
|
|
39
|
-
configuration[
|
|
44
|
+
configuration[:adapter][/postgis/] ? "public, postgis" : "public"
|
|
40
45
|
end
|
|
41
46
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
class Combustion::Databases::SQLServer < Combustion::Databases::Base
|
|
4
4
|
def reset
|
|
5
|
-
establish_connection configuration.merge(
|
|
6
|
-
connection.recreate_database! configuration[
|
|
5
|
+
establish_connection configuration.merge(:database => "master")
|
|
6
|
+
connection.recreate_database! configuration[:database]
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -8,7 +8,7 @@ class Combustion::Databases::SQLite < Combustion::Databases::Base
|
|
|
8
8
|
|
|
9
9
|
def create
|
|
10
10
|
if exists?
|
|
11
|
-
warn "#{config[
|
|
11
|
+
warn "#{config[:database]} already exists"
|
|
12
12
|
return
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -32,6 +32,6 @@ class Combustion::Databases::SQLite < Combustion::Databases::Base
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def path
|
|
35
|
-
@path ||= Pathname.new configuration[
|
|
35
|
+
@path ||= Pathname.new configuration[:database]
|
|
36
36
|
end
|
|
37
37
|
end
|
data/lib/combustion/generator.rb
CHANGED
|
@@ -23,8 +23,11 @@ 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
|
-
|
|
27
|
-
|
|
26
|
+
template "templates/storage.yml", "spec/internal/config/storage.yml"
|
|
27
|
+
|
|
28
|
+
create_file "spec/internal/app/assets/config/manifest.js"
|
|
29
|
+
create_file "spec/internal/public/favicon.ico"
|
|
30
|
+
create_file "spec/internal/log/.gitignore" do
|
|
28
31
|
"*.log"
|
|
29
32
|
end
|
|
30
33
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rubygems"
|
|
4
|
+
|
|
5
|
+
module Combustion
|
|
6
|
+
class VersionGate
|
|
7
|
+
def self.call(name, *constraints)
|
|
8
|
+
new(name).call(*constraints)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def initialize(name)
|
|
12
|
+
@name = name
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Using matches_spec? instead of match? because the former returns true
|
|
16
|
+
# even when the spec has an appropriate _pre-release_ version.
|
|
17
|
+
def call(*constraints)
|
|
18
|
+
return false if spec.nil?
|
|
19
|
+
|
|
20
|
+
dependency(*constraints).matches_spec?(spec)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
attr_reader :name
|
|
26
|
+
|
|
27
|
+
def dependency(*constraints)
|
|
28
|
+
Gem::Dependency.new(name, *constraints)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def spec
|
|
32
|
+
Gem.loaded_specs.fetch(name, nil)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/combustion.rb
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
require "rails"
|
|
4
4
|
require "active_support/dependencies"
|
|
5
5
|
|
|
6
|
+
require "combustion/version_gate"
|
|
7
|
+
|
|
6
8
|
module Combustion
|
|
7
9
|
module Configurations
|
|
8
10
|
end
|
|
@@ -12,18 +14,40 @@ module Combustion
|
|
|
12
14
|
self.path = "/spec/internal"
|
|
13
15
|
self.schema_format = :ruby
|
|
14
16
|
|
|
15
|
-
MODULES =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
MODULES = {
|
|
18
|
+
:active_model => "active_model/railtie",
|
|
19
|
+
:active_record => "active_record/railtie",
|
|
20
|
+
:action_controller => "action_controller/railtie",
|
|
21
|
+
:action_mailer => "action_mailer/railtie",
|
|
22
|
+
:action_view => "action_view/railtie",
|
|
23
|
+
:sprockets => "sprockets/railtie",
|
|
24
|
+
:active_job => "active_job/railtie",
|
|
25
|
+
:action_cable => "action_cable/engine",
|
|
26
|
+
:active_storage => "active_storage/engine",
|
|
27
|
+
:action_text => "action_text/engine",
|
|
28
|
+
:action_mailbox => "action_mailbox/engine"
|
|
29
|
+
}.freeze
|
|
30
|
+
|
|
31
|
+
AVAILABLE_MODULES = begin
|
|
32
|
+
keys = MODULES.keys
|
|
33
|
+
rails_gate = VersionGate.new("railties")
|
|
34
|
+
|
|
35
|
+
keys.delete(:sprockets) unless rails_gate.call(">= 3.1", "< 7.0")
|
|
36
|
+
keys.delete(:active_job) unless rails_gate.call(">= 4.2")
|
|
37
|
+
keys.delete(:action_cable) unless rails_gate.call(">= 5.0")
|
|
38
|
+
keys.delete(:active_storage) unless rails_gate.call(">= 5.2")
|
|
39
|
+
keys.delete(:action_text) unless rails_gate.call(">= 6.0")
|
|
40
|
+
keys.delete(:action_mailbox) unless rails_gate.call(">= 6.0")
|
|
41
|
+
|
|
42
|
+
keys
|
|
43
|
+
end.freeze
|
|
20
44
|
|
|
21
45
|
def self.initialize!(*modules, &block)
|
|
22
46
|
self.setup_environment = block if block_given?
|
|
23
47
|
|
|
24
48
|
options = modules.extract_options!
|
|
25
|
-
modules =
|
|
26
|
-
modules.each { |mod| require "#{mod}/railtie" }
|
|
49
|
+
modules = AVAILABLE_MODULES if modules == [:all]
|
|
50
|
+
modules.each { |mod| require MODULES.fetch(mod, "#{mod}/railtie") }
|
|
27
51
|
|
|
28
52
|
Bundler.require :default, Rails.env
|
|
29
53
|
|
|
@@ -65,8 +89,9 @@ module Combustion
|
|
|
65
89
|
end
|
|
66
90
|
end
|
|
67
91
|
|
|
68
|
-
require "combustion/application"
|
|
69
92
|
require "combustion/configurations/action_controller"
|
|
70
93
|
require "combustion/configurations/action_mailer"
|
|
71
94
|
require "combustion/configurations/active_record"
|
|
95
|
+
require "combustion/configurations/active_storage"
|
|
96
|
+
require "combustion/application"
|
|
72
97
|
require "combustion/database"
|
data/spec/database_spec.rb
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
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
|
-
|
|
16
|
+
it "returns test database for model with default connection" do
|
|
17
|
+
if Combustion::VersionGate.call("activerecord", ">= 6.1")
|
|
18
|
+
expect(Model.connection_db_config.database).to match(/combustion/)
|
|
19
|
+
else
|
|
20
|
+
expect(Model.connection_config[:database]).to match(/combustion/)
|
|
25
21
|
end
|
|
22
|
+
end
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
it "returns test_another for model with connection to second database" do
|
|
25
|
+
if Combustion::VersionGate.call("activerecord", ">= 6.1")
|
|
26
|
+
expect(ModelInAnotherDb.connection_db_config.database).
|
|
27
|
+
to match(/test_another/)
|
|
28
|
+
else
|
|
28
29
|
expect(ModelInAnotherDb.connection_config[:database]).
|
|
29
30
|
to match(/test_another/)
|
|
30
31
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
test: &defaults
|
|
2
2
|
adapter: <%= ENV.fetch("DB_ADAPTER") %>
|
|
3
|
-
database:
|
|
3
|
+
database: combustion
|
|
4
4
|
<% if ENV["DB_HOST"] %>
|
|
5
5
|
host: <%= ENV["DB_HOST"] %>
|
|
6
6
|
<% end %>
|
|
@@ -9,6 +9,14 @@ 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
|
+
|
|
16
|
+
<% if ENV["DB_PORT"] %>
|
|
17
|
+
port: <%= ENV["DB_PORT"] %>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
12
20
|
|
|
13
21
|
test_another:
|
|
14
22
|
<<: *defaults
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "bundler/setup"
|
|
4
3
|
require "combustion"
|
|
5
4
|
|
|
6
|
-
if
|
|
5
|
+
if Combustion::VersionGate.call("rails", "< 4.1")
|
|
7
6
|
require "active_record"
|
|
8
7
|
require "active_record/connection_adapters/mysql2_adapter"
|
|
9
8
|
|
|
@@ -13,3 +12,7 @@ if Rails::VERSION::STRING.to_f < 4.1
|
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
require File.expand_path("dummy/lib/engine.rb", __dir__)
|
|
15
|
+
|
|
16
|
+
Dir.chdir(File.expand_path("dummy", __dir__)) do
|
|
17
|
+
Combustion.initialize! :all
|
|
18
|
+
end
|
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.5.0
|
|
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:
|
|
11
|
+
date: 2024-07-07 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.
|
|
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.
|
|
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.
|
|
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.
|
|
138
|
+
version: 0.81.0
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: sqlite3
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -158,32 +158,19 @@ executables:
|
|
|
158
158
|
extensions: []
|
|
159
159
|
extra_rdoc_files: []
|
|
160
160
|
files:
|
|
161
|
-
- ".gitignore"
|
|
162
161
|
- ".rspec"
|
|
163
|
-
- ".rubocop.yml"
|
|
164
|
-
- ".travis.yml"
|
|
165
162
|
- Appraisals
|
|
166
163
|
- Gemfile
|
|
167
|
-
- HISTORY
|
|
168
164
|
- LICENCE
|
|
169
165
|
- README.md
|
|
170
166
|
- Rakefile
|
|
171
|
-
- combustion.gemspec
|
|
172
167
|
- exe/combust
|
|
173
|
-
- gemfiles/rails_3.1.gemfile
|
|
174
|
-
- gemfiles/rails_3.2.gemfile
|
|
175
|
-
- gemfiles/rails_4.0.gemfile
|
|
176
|
-
- gemfiles/rails_4.1.gemfile
|
|
177
|
-
- gemfiles/rails_4.2.gemfile
|
|
178
|
-
- gemfiles/rails_5.0.gemfile
|
|
179
|
-
- gemfiles/rails_5.1.gemfile
|
|
180
|
-
- gemfiles/rails_5.2.gemfile
|
|
181
|
-
- gemfiles/rails_5_0.gemfile
|
|
182
168
|
- lib/combustion.rb
|
|
183
169
|
- lib/combustion/application.rb
|
|
184
170
|
- lib/combustion/configurations/action_controller.rb
|
|
185
171
|
- lib/combustion/configurations/action_mailer.rb
|
|
186
172
|
- lib/combustion/configurations/active_record.rb
|
|
173
|
+
- lib/combustion/configurations/active_storage.rb
|
|
187
174
|
- lib/combustion/database.rb
|
|
188
175
|
- lib/combustion/database/load_schema.rb
|
|
189
176
|
- lib/combustion/database/migrate.rb
|
|
@@ -196,26 +183,30 @@ files:
|
|
|
196
183
|
- lib/combustion/databases/sql_server.rb
|
|
197
184
|
- lib/combustion/databases/sqlite.rb
|
|
198
185
|
- lib/combustion/generator.rb
|
|
186
|
+
- lib/combustion/version_gate.rb
|
|
199
187
|
- spec/database_spec.rb
|
|
200
188
|
- spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
|
|
201
189
|
- spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
|
|
202
190
|
- spec/dummy/lib/engine.rb
|
|
191
|
+
- spec/dummy/spec/internal/app/assets/config/manifest.js
|
|
203
192
|
- spec/dummy/spec/internal/app/models/model.rb
|
|
204
193
|
- spec/dummy/spec/internal/app/models/model_in_another_db.rb
|
|
194
|
+
- spec/dummy/spec/internal/combustion
|
|
205
195
|
- spec/dummy/spec/internal/config/database.yml
|
|
206
196
|
- spec/dummy/spec/internal/config/routes.rb
|
|
207
197
|
- spec/dummy/spec/internal/db/schema.rb
|
|
208
|
-
- spec/dummy/spec/internal/log/.gitignore
|
|
209
198
|
- spec/spec_helper.rb
|
|
210
199
|
- templates/config.ru
|
|
211
200
|
- templates/database.yml
|
|
212
201
|
- templates/routes.rb
|
|
213
202
|
- templates/schema.rb
|
|
203
|
+
- templates/storage.yml
|
|
214
204
|
homepage: https://github.com/pat/combustion
|
|
215
205
|
licenses:
|
|
216
206
|
- MIT
|
|
217
|
-
metadata:
|
|
218
|
-
|
|
207
|
+
metadata:
|
|
208
|
+
rubygems_mfa_required: 'true'
|
|
209
|
+
post_install_message:
|
|
219
210
|
rdoc_options: []
|
|
220
211
|
require_paths:
|
|
221
212
|
- lib
|
|
@@ -230,9 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
230
221
|
- !ruby/object:Gem::Version
|
|
231
222
|
version: '0'
|
|
232
223
|
requirements: []
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
signing_key:
|
|
224
|
+
rubygems_version: 3.3.3
|
|
225
|
+
signing_key:
|
|
236
226
|
specification_version: 4
|
|
237
227
|
summary: Elegant Rails Engine Testing
|
|
238
228
|
test_files:
|
|
@@ -240,10 +230,15 @@ test_files:
|
|
|
240
230
|
- spec/dummy/db/migrate/20150717075542_create_dummy_test_table.rb
|
|
241
231
|
- spec/dummy/db/migrate/20150717075543_create_dummy_test_table_in_another_db.rb
|
|
242
232
|
- spec/dummy/lib/engine.rb
|
|
233
|
+
- spec/dummy/spec/internal/app/assets/config/manifest.js
|
|
243
234
|
- spec/dummy/spec/internal/app/models/model.rb
|
|
244
235
|
- spec/dummy/spec/internal/app/models/model_in_another_db.rb
|
|
236
|
+
- spec/dummy/spec/internal/combustion
|
|
245
237
|
- spec/dummy/spec/internal/config/database.yml
|
|
246
238
|
- spec/dummy/spec/internal/config/routes.rb
|
|
247
239
|
- spec/dummy/spec/internal/db/schema.rb
|
|
248
|
-
- spec/dummy/spec/internal/log/.gitignore
|
|
249
240
|
- spec/spec_helper.rb
|
|
241
|
+
- ".rspec"
|
|
242
|
+
- Appraisals
|
|
243
|
+
- Gemfile
|
|
244
|
+
- Rakefile
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
inherit_from:
|
|
2
|
-
- https://gist.githubusercontent.com/pat/ba3b8ffb1901bfe5439b460943b6b019/raw/.rubocop.yml
|
|
3
|
-
|
|
4
|
-
AllCops:
|
|
5
|
-
TargetRubyVersion: 2.2
|
|
6
|
-
|
|
7
|
-
Bundler/OrderedGems:
|
|
8
|
-
Exclude:
|
|
9
|
-
- 'gemfiles/*'
|
|
10
|
-
|
|
11
|
-
Layout/DotPosition:
|
|
12
|
-
EnforcedStyle: trailing
|
|
13
|
-
|
|
14
|
-
Layout/CaseIndentation:
|
|
15
|
-
EnforcedStyle: end
|
|
16
|
-
|
|
17
|
-
Layout/EndAlignment:
|
|
18
|
-
EnforcedStyleAlignWith: variable
|
|
19
|
-
|
|
20
|
-
Layout/IndentHeredoc:
|
|
21
|
-
Enabled: false
|
|
22
|
-
|
|
23
|
-
Metrics/BlockLength:
|
|
24
|
-
Exclude:
|
|
25
|
-
- 'combustion.gemspec'
|
|
26
|
-
|
|
27
|
-
Style/ClassAndModuleChildren:
|
|
28
|
-
Enabled: false
|
|
29
|
-
|
|
30
|
-
Style/Documentation:
|
|
31
|
-
Enabled: false
|
|
32
|
-
|
|
33
|
-
Style/FrozenStringLiteralComment:
|
|
34
|
-
Exclude:
|
|
35
|
-
- 'gemfiles/*'
|
|
36
|
-
|
|
37
|
-
Style/MultilineTernaryOperator:
|
|
38
|
-
Exclude:
|
|
39
|
-
- 'spec/dummy/db/migrate/*.rb'
|
data/.travis.yml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
env:
|
|
3
|
-
matrix:
|
|
4
|
-
- "DB_ADAPTER=sqlite3"
|
|
5
|
-
- "DB_ADAPTER=postgresql"
|
|
6
|
-
- "DB_ADAPTER=mysql2"
|
|
7
|
-
rvm:
|
|
8
|
-
- 2.2.10
|
|
9
|
-
- 2.3.7
|
|
10
|
-
- 2.4.4
|
|
11
|
-
- 2.5.1
|
|
12
|
-
before_install:
|
|
13
|
-
- gem update --system
|
|
14
|
-
- gem install bundler
|
|
15
|
-
before_script:
|
|
16
|
-
- bundle exec appraisal install
|
|
17
|
-
script: 'bundle exec appraisal rake'
|
|
18
|
-
services:
|
|
19
|
-
- mysql
|
|
20
|
-
- postgresql
|
data/HISTORY
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
1.0.0 - October 3rd 2018
|
|
2
|
-
* No functional changes.
|
|
3
|
-
* Added documentation about database preparation options.
|
|
4
|
-
|
|
5
|
-
0.9.1 - April 25th 2018
|
|
6
|
-
* Fix Rails 5.2 compatibility by not setting the deprecated secret_token configuration option.
|
|
7
|
-
|
|
8
|
-
0.9.0 - March 26th 2018
|
|
9
|
-
* Only reset databases that are either custom or the current one (Moritz Winter).
|
|
10
|
-
* More consistency around environment handling (rather than presuming it's always the test environment).
|
|
11
|
-
|
|
12
|
-
0.8.0 - February 1st 2018
|
|
13
|
-
* Rails 5.2.0 support.
|
|
14
|
-
* Requiring digest from std-lib directly.
|
|
15
|
-
* Refactoring for cleaner code.
|
|
16
|
-
|
|
17
|
-
0.7.0 - June 20th 2017
|
|
18
|
-
* Confirm support for MRI frozen string literals.
|
|
19
|
-
* Hide migration output (Michael Grosser).
|
|
20
|
-
|
|
21
|
-
0.6.0 - March 28th 2017
|
|
22
|
-
* Optionally disable database reset, schema loading, migrations (Sergey Kucher).
|
|
23
|
-
* Allow for multiple test databases (Semyon Pupkov).
|
|
24
|
-
|
|
25
|
-
0.5.5 - July 23rd 2016
|
|
26
|
-
* Add PostGIS support (Roland Koch).
|
|
27
|
-
* MySQL parameter fix (Mathieu Leduc-Hamel).
|
|
28
|
-
|
|
29
|
-
0.5.4 - January 12th 2016
|
|
30
|
-
* Remove silent_stream call for Rails 5.0 compatability (Bryan Ricker).
|
|
31
|
-
* Fix duplicate migrations error (Semyon Pupkov).
|
|
32
|
-
|
|
33
|
-
0.5.3 - March 1st 2015
|
|
34
|
-
* Use migrations from dependent gems (Korotaev Danil, Меркушин Михаил).
|
|
35
|
-
|
|
36
|
-
0.5.2 - July 18th 2014
|
|
37
|
-
* Note MIT licence in gemspec (@ktdreyer).
|
|
38
|
-
* Use local create/drop methods when resetting database (Bryan Ricker).
|
|
39
|
-
* ERB is now supported in config/database.yml, matching Rails (@patorash).
|
|
40
|
-
* The database now is configured before the application is loaded (@patorash).
|
|
41
|
-
* Documentation and generated config.ru now specify explicly loading all Rails libraries by default (Pat Allan).
|
|
42
|
-
|
|
43
|
-
0.5.1 - July 25th 2013
|
|
44
|
-
* Mass assignment errors raise exceptions instead of just being logged (Pat Allan).
|
|
45
|
-
* whilelist_attributes is only set for Rails 3.2 apps (Philip Arndt).
|
|
46
|
-
* Support ActiveRecord 3.0.x (Philip Arndt).
|
|
47
|
-
* Allow custom application configuration (Pablo Herrero).
|
|
48
|
-
|
|
49
|
-
0.5.0 - May 1st 2013
|
|
50
|
-
* whitelist_attributes is now set within configure_for_combustion, as it depends on which Railties are loaded.
|
|
51
|
-
* Make sure Rails gems are loaded before the engine's gem (Pablo Herrero).
|
|
52
|
-
* Fixed Rails version comparison (Josh Adam).
|
|
53
|
-
|
|
54
|
-
0.4.0 - March 16th 2013
|
|
55
|
-
* Don't delete the SQLite test database if it doesn't exist (Michael Gee, Alexander Rozumiy).
|
|
56
|
-
* Support for secret_key_base for Rails 4 apps (Philip Arndt).
|
|
57
|
-
* eager_load is set to true when using the production environment (Philip Arndt).
|
|
58
|
-
* whiny_nils is not set if using Rails 4 (Philip Arndt).
|
|
59
|
-
* Mysql2 can raise Mysql::Error with JRuby (Philip Arndt).
|
|
60
|
-
* Whitelist attributes typo is fixed (Geoff Hodgson).
|
|
61
|
-
* Mass assignment checks are now turned on, so errors are raised. This matches Rails' defaults for test environments (Josh Adams).
|
|
62
|
-
* Combustion no longer loads all of the Rails stack by default, just Railties and ActiveSupport. A combustion-rails gem will be created that uses all of Rails by default (Philip Arndt).
|
|
63
|
-
* Combustion classes now all define the outer module, so each can be required by themselves, should you desire (Philip Arndt).
|
|
64
|
-
|
|
65
|
-
0.3.3 - December 23rd 2012
|
|
66
|
-
* Removing version file - version number can just live in the gemspec.
|
|
67
|
-
* Load ActionController and ActionMailer via their Railties, not non-existent Engines (Chris Beer).
|
|
68
|
-
* SQL Schema support (Geoff Hodgson).
|
|
69
|
-
* Documentation fixes (Philip Arndt, Inge Jørgensen, Erkan Yilmaz).
|
|
70
|
-
* Include migrations from the internal app when migrating the database (Warren Seen).
|
|
71
|
-
* Correctly drop the test database when using SQLite (Warren Seen).
|
|
72
|
-
* Don't attempt to load sprockets for Rails 3.0.x (Alex Rozumey).
|
|
73
|
-
|
|
74
|
-
0.3.2 - March 3rd 2012
|
|
75
|
-
* Tentative Rails 3.0 and migrations support.
|
|
76
|
-
* Allow for different internal app directory.
|
|
77
|
-
|
|
78
|
-
0.3.1 - September 12th 2011
|
|
79
|
-
* Allow for different versions of Capybara (Leo Liang).
|
|
80
|
-
* Including Capybara::DSL instead of Capybara.
|
|
81
|
-
* Require 3.1.0 or better.
|
|
82
|
-
* Allow for JRuby in the database.yml template (Philip Arndt).
|
|
83
|
-
|
|
84
|
-
0.3.0 - September 2nd 2011
|
|
85
|
-
* Simple generator to create a pretty minimal internal Rails app.
|
|
86
|
-
|
|
87
|
-
0.2.0 - August 30th 2011
|
|
88
|
-
* Documentation.
|
|
89
|
-
* Allow developers to choose which Rails modules they wish to be loaded.
|
|
90
|
-
* Load Rails routes and Capybara helpers into RSpec examples when appropriate.
|
|
91
|
-
|
|
92
|
-
0.1.1 - August 24th 2011
|
|
93
|
-
* Support assets properly by loading ActionView and Sprockets railties.
|
|
94
|
-
|
|
95
|
-
0.1.0 - August 19th 2011
|
|
96
|
-
* First release, extracted from Dobro for HyperTiny.
|
data/combustion.gemspec
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |s|
|
|
4
|
-
s.name = "combustion"
|
|
5
|
-
s.version = "1.0.0"
|
|
6
|
-
s.authors = ["Pat Allan"]
|
|
7
|
-
s.email = ["pat@freelancing-gods.com"]
|
|
8
|
-
s.homepage = "https://github.com/pat/combustion"
|
|
9
|
-
s.summary = "Elegant Rails Engine Testing"
|
|
10
|
-
s.description = "Test your Rails Engines without needing a full Rails app"
|
|
11
|
-
s.license = "MIT"
|
|
12
|
-
|
|
13
|
-
s.rubyforge_project = "combustion"
|
|
14
|
-
|
|
15
|
-
s.files = `git ls-files`.split("\n")
|
|
16
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
|
-
s.executables = `git ls-files -- exe/*`.split("\n").map do |file|
|
|
18
|
-
File.basename(file)
|
|
19
|
-
end
|
|
20
|
-
s.bindir = "exe"
|
|
21
|
-
s.require_paths = ["lib"]
|
|
22
|
-
|
|
23
|
-
s.add_runtime_dependency "activesupport", ">= 3.0.0"
|
|
24
|
-
s.add_runtime_dependency "railties", ">= 3.0.0"
|
|
25
|
-
s.add_runtime_dependency "thor", ">= 0.14.6"
|
|
26
|
-
|
|
27
|
-
s.add_development_dependency "appraisal", "~> 2.1.0"
|
|
28
|
-
s.add_development_dependency "mysql2"
|
|
29
|
-
s.add_development_dependency "pg"
|
|
30
|
-
s.add_development_dependency "rails"
|
|
31
|
-
s.add_development_dependency "rspec"
|
|
32
|
-
s.add_development_dependency "rubocop", "~> 0.54.0"
|
|
33
|
-
s.add_development_dependency "sqlite3"
|
|
34
|
-
end
|
data/gemfiles/rails_3.1.gemfile
DELETED
data/gemfiles/rails_3.2.gemfile
DELETED
data/gemfiles/rails_4.0.gemfile
DELETED
data/gemfiles/rails_4.1.gemfile
DELETED
data/gemfiles/rails_4.2.gemfile
DELETED
data/gemfiles/rails_5.0.gemfile
DELETED
data/gemfiles/rails_5.1.gemfile
DELETED
data/gemfiles/rails_5.2.gemfile
DELETED
data/gemfiles/rails_5_0.gemfile
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*.log
|