togls 2.2.0 → 2.2.1

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
  SHA1:
3
- metadata.gz: 9abbf07a34b200f7000e94608724c8499cd0277a
4
- data.tar.gz: 5724c3c1c652bf825a1de22b539b1f848f1d1a11
3
+ metadata.gz: e07a68d3fc95321858fb09e282d568faa8957588
4
+ data.tar.gz: 6af7cd9bd40afb53d6d367b232e690d34e2d675d
5
5
  SHA512:
6
- metadata.gz: a74f6677b8c623e757a32c3bddcc026571485263bbf75ad6ac4c5ab53c22856e26299835d1bf83e7ac6b62bfddea4698754a04ab2738249e477ab7719b16aeab
7
- data.tar.gz: c3cd113e76fc0035bd3994684cc84208a69fb9e496a4402dfa23c9c0dc47e510277fa8cb73344c541fd8465c75ac3db03b844ecece48d1f23e40a83d88c72691
6
+ metadata.gz: 2d66393fb05305227911e1a9fd56e2b651cddd9e7efec9e6980ac37eae888fa16fa2fc6542ffdb5d5fa016be099c1566ff345f6b7e1b470f37a885433cab7de0
7
+ data.tar.gz: ef4b6e18ba83c0ab616a853daf405f606ce5b56db09e76a04c1230399e8feaa67ff13dae6b06361275d3d34a45e38280caf2becdd88cd694531e5f370f41507b
data/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ versions, as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ ### v2.2.1
10
+
11
+ * Added: in-memory driver `set`, `get`, `all` Marshaling to correct a threading
12
+ reference based collision. Fixes issue #35
13
+
9
14
  ### v2.2.0
10
15
 
11
16
  * Changed Togls to be thread-safe
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [![Code Climate](https://codeclimate.com/github/codebreakdown/togls/badges/gpa.svg)](https://codeclimate.com/github/codebreakdown/togls)
4
4
  [![Test Coverage](https://codeclimate.com/github/codebreakdown/togls/badges/coverage.svg)](https://codeclimate.com/github/codebreakdown/togls/coverage)
5
5
  [![Dependency Status](https://gemnasium.com/codebreakdown/togls.svg)](https://gemnasium.com/codebreakdown/togls)
6
+ [![Inline docs](http://inch-ci.org/github/codebreakdown/togls.svg?branch=master)](http://inch-ci.org/github/codebreakdown/togls)
6
7
 
7
8
  # Togls
8
9
 
@@ -14,13 +14,17 @@ module Togls
14
14
 
15
15
  def store(feature_id, feature_data)
16
16
  @features_lock.synchronize do
17
- @features[feature_id] = feature_data
17
+ @features[feature_id] = Marshal.dump(feature_data)
18
18
  end
19
19
  end
20
20
 
21
21
  def get(feature_id)
22
22
  @features_lock.synchronize do
23
- @features[feature_id]
23
+ if @features.has_key?(feature_id)
24
+ Marshal.load(@features[feature_id])
25
+ else
26
+ nil
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -14,13 +14,17 @@ module Togls
14
14
 
15
15
  def store(rule_id, rule_data)
16
16
  @rules_lock.synchronize do
17
- @rules[rule_id] = rule_data
17
+ @rules[rule_id] = Marshal.dump(rule_data)
18
18
  end
19
19
  end
20
20
 
21
21
  def get(rule_id)
22
22
  @rules_lock.synchronize do
23
- @rules[rule_id]
23
+ if @rules.has_key?(rule_id)
24
+ Marshal.load(@rules[rule_id])
25
+ else
26
+ nil
27
+ end
24
28
  end
25
29
  end
26
30
  end
@@ -14,20 +14,26 @@ module Togls
14
14
 
15
15
  def store(toggle_id, toggle_data)
16
16
  @toggles_lock.synchronize do
17
- @toggles[toggle_id] = toggle_data
17
+ @toggles[toggle_id] = Marshal.dump(toggle_data)
18
18
  end
19
19
  end
20
20
 
21
21
  def get(toggle_id)
22
22
  @toggles_lock.synchronize do
23
- @toggles[toggle_id]
23
+ if @toggles.has_key?(toggle_id)
24
+ Marshal.load(@toggles[toggle_id])
25
+ else
26
+ nil
27
+ end
24
28
  end
25
29
  end
26
30
 
27
31
  def all
32
+ result = {}
28
33
  @toggles_lock.synchronize do
29
- @toggles
34
+ @toggles.each_pair { |k, v| result[k] = Marshal.load(v) }
30
35
  end
36
+ result
31
37
  end
32
38
  end
33
39
  end
data/lib/togls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Togls
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: togls
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Miller
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-03-04 00:00:00.000000000 Z
13
+ date: 2016-03-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -145,4 +145,3 @@ signing_key:
145
145
  specification_version: 4
146
146
  summary: An ultra light weight yet ridiculously powerfulruby feature toggle gem.
147
147
  test_files: []
148
- has_rdoc: