test-prof 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/test_prof/recipes/active_record_shared_connection.rb +15 -0
- data/lib/test_prof/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7a28cb7092435d6e8d053a9c50e698f3665dfec31a300b51d40ac04c615978d
|
4
|
+
data.tar.gz: 1707c8668e817ba5ea961a2c415e6a253e390d103973d0108215f4cf4b5af725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b32c1c84e619f109120b6c83e10d050861618179cc55d11d5cf33ad2760275d934a7280247781b44970b0433ef8eed55afbbd3bc724b0e13f9afd0470a1a0008
|
7
|
+
data.tar.gz: 71639f7f96fc5274c0a9eefa76da473c00d9819260987ad315273a301e3331c72b7113b3d3a7b3246a7bef3bd5ff0177147a17846afc2eae6f5f847a0842df73
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 0.7.1 (2018-08-20)
|
6
|
+
|
7
|
+
- Add ability to ignore connection configurations in shared connection.([@palkan][])
|
8
|
+
|
9
|
+
Example:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
# Do not use shared connection for sqlite db
|
13
|
+
TestProf::ActiveRecordSharedConnection.ignore { |config| config[:adapter] == "sqlite3" }
|
14
|
+
```
|
15
|
+
|
5
16
|
## 0.7.0 (2018-08-12)
|
6
17
|
|
7
18
|
- **Ruby 2.3+ is required**. ([@palkan][])
|
@@ -14,8 +14,22 @@ module TestProf
|
|
14
14
|
self.connection = nil
|
15
15
|
end
|
16
16
|
|
17
|
+
def ignore
|
18
|
+
raise ArgumentError, "Block is required" unless block_given?
|
19
|
+
|
20
|
+
@ignores ||= []
|
21
|
+
|
22
|
+
ignores << Proc.new
|
23
|
+
end
|
24
|
+
|
25
|
+
def ignored?(config)
|
26
|
+
!ignores.nil? && ignores.any? { |clbk| clbk.call(config) }
|
27
|
+
end
|
28
|
+
|
17
29
|
private
|
18
30
|
|
31
|
+
attr_reader :ignores
|
32
|
+
|
19
33
|
def connection=(conn)
|
20
34
|
@connection = conn
|
21
35
|
connection.singleton_class.prepend Connection
|
@@ -43,6 +57,7 @@ module TestProf
|
|
43
57
|
|
44
58
|
module Ext
|
45
59
|
def connection
|
60
|
+
return super if ActiveRecordSharedConnection.ignored?(connection_config)
|
46
61
|
ActiveRecordSharedConnection.connection || super
|
47
62
|
end
|
48
63
|
end
|
data/lib/test_prof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|