bone 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +8 -0
- data/bone.gemspec +1 -1
- data/lib/bone.rb +17 -1
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
BONE, CHANGES
|
2
2
|
|
3
|
+
#### 0.2.3 (2010-01-09) ###############################
|
4
|
+
|
5
|
+
* CHANGE: Bone.get and Bone[] no longer raise an exception for unknown keys
|
6
|
+
* CHANGE: Bone.set and Bone[]= no longer raise an exception for unknown keys
|
7
|
+
* ADDED: Bone.get! to raise exception for unknown keys.
|
8
|
+
* ADDED: Bone.set! to raise exception for unknown keys.
|
9
|
+
|
10
|
+
|
3
11
|
#### 0.2.2 (2010-01-08) ###############################
|
4
12
|
|
5
13
|
* FIXED: Bone.keys returns Array instead of String
|
data/bone.gemspec
CHANGED
data/lib/bone.rb
CHANGED
@@ -7,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
module Bone
|
9
9
|
extend self
|
10
|
-
VERSION = "0.2.
|
10
|
+
VERSION = "0.2.3"
|
11
11
|
APIVERSION = 'v1'.freeze
|
12
12
|
|
13
13
|
class Problem < RuntimeError; end
|
@@ -30,12 +30,28 @@ module Bone
|
|
30
30
|
SOURCE = (ENV['BONE_SOURCE'] || "localhost:6043").freeze
|
31
31
|
TOKEN = ENV['BONE_TOKEN'].freeze
|
32
32
|
|
33
|
+
# Get a key from the boned server. Same as `get!`
|
34
|
+
# but does not raise an exception for an unknown key.
|
33
35
|
def get(key, opts={})
|
36
|
+
get! key, opts
|
37
|
+
rescue Bone::Problem
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
# Get a key from the boned server. Raises an exception
|
42
|
+
# for an unknown key.
|
43
|
+
def get!(key, opts={})
|
34
44
|
token = opts[:token] || ENV['BONE_TOKEN'] || TOKEN
|
35
45
|
request(:get, token, key) # returns the response body
|
36
46
|
end
|
37
47
|
|
38
48
|
def set(key, value, opts={})
|
49
|
+
set! key, value, opts
|
50
|
+
rescue Bone::Problem
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
|
54
|
+
def set!(key, value, opts={})
|
39
55
|
token = opts[:token] || ENV['BONE_TOKEN'] || TOKEN
|
40
56
|
opts[:value] = value
|
41
57
|
request(:set, token, key, opts)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-10 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|