database_rewinder 0.9.4 → 0.9.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: f79ac7f52a4377e3b0991fc87a7e0ae0fe50cfc5af519a009d5470e6d8d7e5e3
4
- data.tar.gz: 1fc00b427798e7bb7a573bd13818da4b8a41abe99182b1da7cebc92d938db931
3
+ metadata.gz: b151e420c4e1985e5674d1781dceae421a9e3d9e19c3486cf87529ac14399008
4
+ data.tar.gz: e1ad8090d602a4db4d71626b765c6f932ac8690ae8dfeee40d429f8071465812
5
5
  SHA512:
6
- metadata.gz: 65a551ce2bbe957514861dd56e0e4f758ea4f0c93e7ca6052efb24b2033b68c200228253dfafe6f9737214edaf870087c48300d15be854849f7a5a6d0c797a0d
7
- data.tar.gz: 841d80ce6639746df70f78b728b5498a117e4f7cfca84e4e8de7de4bc1c2c393f5cfb60c4827e9b551d9a49bd67ecbc30ecf27ad4042cd38d457c23a09e7614c
6
+ metadata.gz: acca967b5d15e66623e5767fcc9304d56e0d19074f5c02619e77c50f6dacfb51bf0289e6ef64252884f2b2fb88ae198b6abde6b152d0beaf7c13e2c4df290552
7
+ data.tar.gz: 9be584317f373acaa2797ff723b4e0a2e7e8121a0aecad1920ecb01b06307224e35238e10ede1a5ec43a3a4eb74511b760b132711c4cbf8dfb55d52700626d26
data/.travis.yml CHANGED
@@ -20,11 +20,12 @@ env:
20
20
  - DB=postgresql
21
21
 
22
22
  rvm:
23
- - 2.6.3
23
+ - 2.7.3
24
24
 
25
25
  gemfile:
26
26
  - gemfiles/rails_52.gemfile
27
27
  - gemfiles/rails_60.gemfile
28
+ - gemfiles/rails_61.gemfile
28
29
 
29
30
  sudo: false
30
31
 
@@ -32,16 +33,22 @@ dist: xenial
32
33
 
33
34
  matrix:
34
35
  include:
35
- - rvm: 2.7.1
36
+ - rvm: 3.0.1
37
+ gemfile: gemfiles/rails_edge.gemfile
38
+ env: DB=postgresql
39
+ - rvm: 3.0.1
40
+ gemfile: gemfiles/rails_61.gemfile
41
+ env: DB=postgresql
42
+ - rvm: 2.6.7
36
43
  gemfile: gemfiles/rails_60.gemfile
37
44
  env: DB=postgresql
38
- - rvm: 2.6.3
39
- gemfile: gemfiles/rails_edge.gemfile
45
+ - rvm: 2.6.7
46
+ gemfile: gemfiles/rails_52.gemfile
40
47
  env: DB=postgresql
41
- - rvm: 2.5.5
48
+ - rvm: 2.5.9
42
49
  gemfile: gemfiles/rails_51.gemfile
43
50
  env: DB=postgresql
44
- - rvm: 2.4.6
51
+ - rvm: 2.4.10
45
52
  gemfile: gemfiles/rails_50.gemfile
46
53
  env: DB=postgresql
47
54
  - rvm: 2.3.8
data/README.md CHANGED
@@ -23,9 +23,9 @@ This strategy was originally devised and implemented by Shingo Morita (@eudoxa)
23
23
 
24
24
  ## Supported versions
25
25
 
26
- * ActiveRecord 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0 (edge)
26
+ * ActiveRecord 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0 (edge)
27
27
 
28
- * Ruby 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 (trunk)
28
+ * Ruby 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1 (trunk)
29
29
 
30
30
  ## Installation
31
31
 
@@ -98,7 +98,7 @@ In cases of this situation, bundle database\_rewinder and add the following conf
98
98
 
99
99
  ```ruby
100
100
  RSpec.configure do |config|
101
- config.use_transactional_examples = false
101
+ config.use_transactional_tests = false
102
102
 
103
103
  ...
104
104
  end
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = "database_rewinder"
9
- spec.version = '0.9.4'
9
+ spec.version = '0.9.5'
10
10
  spec.authors = ["Akira Matsuda"]
11
11
  spec.email = ["ronnie@dio.jp"]
12
12
  spec.description = "A minimalist's tiny and ultra-fast database cleaner"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '~> 6.1.0'
4
+ gem 'selenium-webdriver'
5
+
6
+ gemspec path: '../'
@@ -4,7 +4,7 @@ git_source(:github) do |repo_name|
4
4
  "https://github.com/#{repo_name}.git"
5
5
  end
6
6
 
7
- gem 'rails', github: 'rails/rails'
7
+ gem 'rails', github: 'rails/rails', branch: 'main'
8
8
  gem 'selenium-webdriver'
9
9
 
10
10
  gemspec path: '../'
@@ -16,7 +16,7 @@ module DatabaseRewinder
16
16
  end
17
17
 
18
18
  def create_cleaner(connection_name)
19
- config = database_configuration[connection_name] or raise %Q[Database configuration named "#{connection_name}" is not configured.]
19
+ config = configuration_hash_for(connection_name) or raise %Q[Database configuration named "#{connection_name}" is not configured.]
20
20
 
21
21
  Cleaner.new(config: config, connection_name: connection_name, only: @only, except: @except).tap {|c| @cleaners << c}
22
22
  end
@@ -84,14 +84,29 @@ module DatabaseRewinder
84
84
 
85
85
  def get_cache_key(connection_pool)
86
86
  if connection_pool.respond_to?(:db_config) # ActiveRecord >= 6.1
87
- connection_pool.db_config.config
87
+ connection_pool.db_config.configuration_hash
88
88
  else
89
89
  connection_pool.spec.config
90
90
  end
91
91
  end
92
+
93
+ def configuration_hash_for(connection_name)
94
+ if database_configuration.respond_to?(:configs_for)
95
+ hash_config = database_configuration.configs_for(env_name: connection_name).first
96
+ if hash_config
97
+ if hash_config.respond_to?(:configuration_hash)
98
+ hash_config.configuration_hash.stringify_keys
99
+ else
100
+ hash_config.config
101
+ end
102
+ end
103
+ else
104
+ database_configuration[connection_name]
105
+ end
106
+ end
92
107
  end
93
108
 
94
- private_class_method :get_cache_key
109
+ private_class_method :configuration_hash_for, :get_cache_key
95
110
  end
96
111
 
97
112
  begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_rewinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,6 +129,7 @@ files:
129
129
  - gemfiles/rails_51.gemfile
130
130
  - gemfiles/rails_52.gemfile
131
131
  - gemfiles/rails_60.gemfile
132
+ - gemfiles/rails_61.gemfile
132
133
  - gemfiles/rails_edge.gemfile
133
134
  - lib/database_rewinder.rb
134
135
  - lib/database_rewinder/active_record_monkey.rb
@@ -148,7 +149,7 @@ homepage: https://github.com/amatsuda/database_rewinder
148
149
  licenses:
149
150
  - MIT
150
151
  metadata: {}
151
- post_install_message:
152
+ post_install_message:
152
153
  rdoc_options: []
153
154
  require_paths:
154
155
  - lib
@@ -163,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  - !ruby/object:Gem::Version
164
165
  version: '0'
165
166
  requirements: []
166
- rubygems_version: 3.2.0.pre1
167
- signing_key:
167
+ rubygems_version: 3.3.0.dev
168
+ signing_key:
168
169
  specification_version: 4
169
170
  summary: A minimalist's tiny and ultra-fast database cleaner
170
171
  test_files: