knockoff 0.2.0 → 0.2.1
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/lib/knockoff/config.rb +12 -0
- data/lib/knockoff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b71fe8eac98c6f5b545de8676314f8d993362f70
|
|
4
|
+
data.tar.gz: 6899bcf03cc21c9bc6dc56528db0acec3efe5c44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 208629e12804ccf7035ceffa93d3f132cf2ac82c9d0683ccb2e9b71a04f46af8a1f92f5c7349696c093a19208fb7a8e8a56d7ca6bf3cdbd504783f1b2002199f
|
|
7
|
+
data.tar.gz: 9460406988160c910f3a5cb5ef67d74431c67713a548c187347d78ab5548c3443efa474cb8e4b528c61a6d8584b7d838864bfc5db7f593e7908466273ccbbf98
|
data/lib/knockoff/config.rb
CHANGED
|
@@ -14,6 +14,11 @@ module Knockoff
|
|
|
14
14
|
@environment = 'development'
|
|
15
15
|
@replicas_configurations = {}
|
|
16
16
|
set_replica_configs
|
|
17
|
+
|
|
18
|
+
if !properly_configured? && Knockoff.enabled
|
|
19
|
+
puts "[Knockoff] WARNING: Detected enabled Knockoff without proper replica pool configuration. Setting Knockoff.enabled to false."
|
|
20
|
+
Knockoff.enabled = false
|
|
21
|
+
end
|
|
17
22
|
end
|
|
18
23
|
|
|
19
24
|
def replica_database_keys
|
|
@@ -35,6 +40,13 @@ module Knockoff
|
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
|
|
43
|
+
# If replica_configs actually containts some configuration information, then
|
|
44
|
+
# we know it was properly configured. Improper URI's will be ignored during the
|
|
45
|
+
# initialization step.
|
|
46
|
+
def properly_configured?
|
|
47
|
+
!@replica_configs.empty?
|
|
48
|
+
end
|
|
49
|
+
|
|
38
50
|
private
|
|
39
51
|
|
|
40
52
|
def update_replica_config(key, new_configs)
|
data/lib/knockoff/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: knockoff
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Ringwelski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-12-
|
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|