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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6249cf98485220a497bcfe3ae9fc7056606451f
4
- data.tar.gz: ee8347e81037c6a8641849473fb08ddc304eff2c
3
+ metadata.gz: b71fe8eac98c6f5b545de8676314f8d993362f70
4
+ data.tar.gz: 6899bcf03cc21c9bc6dc56528db0acec3efe5c44
5
5
  SHA512:
6
- metadata.gz: 1b2ca3c16d58470005cea91b6f356f540335de2b461f34367a43b8a545dae477cdee607fab03a318915fc638d93001e3774f35616e5211053379dd057d8a201d
7
- data.tar.gz: 92e4702b63d1378d8cacf0f8a02f423880b665c6d6bf19930c30ff0d0d174fdb2e94be4c5b39b3d717ccdedaf5265cd18a54cae05c444b810c0cd00023ff2a70
6
+ metadata.gz: 208629e12804ccf7035ceffa93d3f132cf2ac82c9d0683ccb2e9b71a04f46af8a1f92f5c7349696c093a19208fb7a8e8a56d7ca6bf3cdbd504783f1b2002199f
7
+ data.tar.gz: 9460406988160c910f3a5cb5ef67d74431c67713a548c187347d78ab5548c3443efa474cb8e4b528c61a6d8584b7d838864bfc5db7f593e7908466273ccbbf98
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Knockoff
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord