bone 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +5 -0
- data/Rakefile +1 -1
- data/VERSION.yml +1 -1
- data/bone.gemspec +5 -5
- data/lib/bone/api.rb +8 -4
- data/lib/bone/cli.rb +1 -1
- data/try/25_key_token_object_try.rb +5 -5
- metadata +7 -7
data/CHANGES.txt
CHANGED
data/Rakefile
CHANGED
@@ -25,7 +25,7 @@ begin
|
|
25
25
|
gem.email = "delano@solutious.com"
|
26
26
|
gem.homepage = "https://github.com/solutious/bone"
|
27
27
|
gem.authors = ["Delano Mandelbaum"]
|
28
|
-
gem.add_dependency("familia", ">= 0.6.
|
28
|
+
gem.add_dependency("familia", ">= 0.6.1")
|
29
29
|
gem.add_dependency("em-http-request")
|
30
30
|
end
|
31
31
|
Jeweler::GemcutterTasks.new
|
data/VERSION.yml
CHANGED
data/bone.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bone}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Delano Mandelbaum"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-20}
|
13
13
|
s.default_executable = %q{bone}
|
14
14
|
s.description = %q{A simple store for remote environment variables}
|
15
15
|
s.email = %q{delano@solutious.com}
|
@@ -66,14 +66,14 @@ Gem::Specification.new do |s|
|
|
66
66
|
s.specification_version = 3
|
67
67
|
|
68
68
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
69
|
-
s.add_runtime_dependency(%q<familia>, [">= 0.6.
|
69
|
+
s.add_runtime_dependency(%q<familia>, [">= 0.6.1"])
|
70
70
|
s.add_runtime_dependency(%q<em-http-request>, [">= 0"])
|
71
71
|
else
|
72
|
-
s.add_dependency(%q<familia>, [">= 0.6.
|
72
|
+
s.add_dependency(%q<familia>, [">= 0.6.1"])
|
73
73
|
s.add_dependency(%q<em-http-request>, [">= 0"])
|
74
74
|
end
|
75
75
|
else
|
76
|
-
s.add_dependency(%q<familia>, [">= 0.6.
|
76
|
+
s.add_dependency(%q<familia>, [">= 0.6.1"])
|
77
77
|
s.add_dependency(%q<em-http-request>, [">= 0"])
|
78
78
|
end
|
79
79
|
end
|
data/lib/bone/api.rb
CHANGED
@@ -174,10 +174,14 @@ class Bone
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def canonical_host host
|
177
|
-
|
178
|
-
host.
|
179
|
-
host
|
177
|
+
unless URI === host
|
178
|
+
host = host.to_s unless String === host
|
179
|
+
host.strip!
|
180
|
+
host = "http://#{host}" unless host.match(/^https?:\/\//)
|
181
|
+
host = URI.parse(host)
|
180
182
|
end
|
183
|
+
host.port ||= 80
|
184
|
+
host = [host.host.to_s, host.port.to_s].join(':')
|
181
185
|
host.downcase
|
182
186
|
end
|
183
187
|
|
@@ -332,7 +336,7 @@ class Bone
|
|
332
336
|
end
|
333
337
|
def destroy(token, secret)
|
334
338
|
Token.tokens.delete token
|
335
|
-
Token.new(token).secret.
|
339
|
+
Token.new(token).secret.delete
|
336
340
|
end
|
337
341
|
def register(token, secret)
|
338
342
|
raise RuntimeError, "Could not generate token" if token.nil? || token?(token)
|
data/lib/bone/cli.rb
CHANGED
@@ -9,7 +9,7 @@ Bone::API::Redis::Token.redis_objects.keys.collect(&:to_s).sort
|
|
9
9
|
|
10
10
|
## Bone::API::Redis::Token.redis_objects
|
11
11
|
Bone::API::Redis::Token.class_redis_objects.keys
|
12
|
-
#=> [:tokens]
|
12
|
+
#=> [:tokens, :instances]
|
13
13
|
|
14
14
|
## Bone::API::Redis::Token.new
|
15
15
|
@tobj = Bone::API::Redis::Token.new :atoken
|
@@ -18,7 +18,7 @@ Bone::API::Redis::Token.class_redis_objects.keys
|
|
18
18
|
|
19
19
|
## Bone::API::Redis::Token#secret
|
20
20
|
@tobj.secret.class
|
21
|
-
#=> Familia::
|
21
|
+
#=> Familia::String
|
22
22
|
|
23
23
|
## Bone::API::Redis::Token#secret= doesn't exist
|
24
24
|
@tobj.secret = :poop
|
@@ -26,7 +26,7 @@ Bone::API::Redis::Token.class_redis_objects.keys
|
|
26
26
|
|
27
27
|
## Bone::API::Redis::Token#secret isn't affected by secret=
|
28
28
|
@tobj.secret.class
|
29
|
-
#=> Familia::
|
29
|
+
#=> Familia::String
|
30
30
|
|
31
31
|
## Bone::API::Redis::Token#secret to_s
|
32
32
|
@tobj.secret.to_s
|
@@ -43,7 +43,7 @@ Bone::API::Redis::Key.redis_objects.keys
|
|
43
43
|
|
44
44
|
## Bone::API::Redis::Key#value
|
45
45
|
@kobj.value.class
|
46
|
-
#=> Familia::
|
46
|
+
#=> Familia::String
|
47
47
|
|
48
48
|
## Bone::API::Redis::Key#value to_s returns empty string
|
49
49
|
@kobj.value.to_s
|
@@ -59,7 +59,7 @@ Bone::API::Redis::Key.redis_objects.keys
|
|
59
59
|
|
60
60
|
## Bone::API::Redis::Key#value set
|
61
61
|
@kobj.value.set 'avalue2'
|
62
|
-
#=> '
|
62
|
+
#=> 'OK'
|
63
63
|
|
64
64
|
## Bone::API::Redis::Key#value clear
|
65
65
|
@kobj.value.clear
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Delano Mandelbaum
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-20 00:00:00 -05:00
|
19
19
|
default_executable: bone
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 5
|
30
30
|
segments:
|
31
31
|
- 0
|
32
32
|
- 6
|
33
|
-
-
|
34
|
-
version: 0.6.
|
33
|
+
- 1
|
34
|
+
version: 0.6.1
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|