bone 0.2.1 → 0.2.2
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.
- data/CHANGES.txt +6 -0
- data/README.md +19 -11
- data/bin/bone +1 -1
- data/bone.gemspec +1 -1
- data/lib/bone.rb +6 -2
- data/try/bone.rb +1 -1
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
BONE, CHANGES
|
2
2
|
|
3
|
+
#### 0.2.2 (2010-01-08) ###############################
|
4
|
+
|
5
|
+
* FIXED: Bone.keys returns Array instead of String
|
6
|
+
* CHANGE: Friendly error when no boned
|
7
|
+
|
8
|
+
|
3
9
|
#### 0.2.1 (2009-12-13) ###############################
|
4
10
|
|
5
11
|
* FIXED: Force token generate now works
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
## Bone - 0.2 ##
|
2
2
|
|
3
|
-
**
|
3
|
+
**Environment variables in the "visible mass of condensed water vapour floating in the atmosphere, typically high above the ground."**
|
4
4
|
|
5
|
-
|
5
|
+
## Features
|
6
6
|
|
7
7
|
* Store variables and files remotely
|
8
8
|
* Simple interface
|
9
9
|
|
10
|
-
|
10
|
+
## CLI Example
|
11
11
|
|
12
12
|
# Specify arbitrary keys and values.
|
13
13
|
$ bone set cust_id c397d204aa4e94f566d7f78c
|
@@ -27,36 +27,44 @@
|
|
27
27
|
|
28
28
|
# Show all available keys
|
29
29
|
$ bone keys
|
30
|
+
cust_id
|
31
|
+
redis_conf
|
30
32
|
|
31
|
-
|
32
|
-
== Ruby Example
|
33
|
+
## Ruby Example
|
33
34
|
|
34
35
|
require 'bone'
|
35
36
|
|
36
|
-
ENV['BONE_TOKEN']
|
37
|
+
ENV['BONE_TOKEN'] ||= Bone.generate_token
|
37
38
|
|
38
39
|
Bone[:cust_id] = 'c397d204aa4e94f566d7f78c'
|
39
40
|
Bone[:redis_conf] = File.read('config/redis-server.conf')
|
40
41
|
|
42
|
+
Bone[:cust_id] # => "c397d204aa4e94f566d7f78c"
|
43
|
+
Bone[:redis_conf] # => "# Redis configuration file example..."
|
44
|
+
|
41
45
|
|
42
|
-
|
46
|
+
## Installation
|
43
47
|
|
44
48
|
$ sudo gem install bone
|
49
|
+
$ bone token
|
50
|
+
$ export BONE_TOKEN=YOURTOKEN
|
45
51
|
|
52
|
+
You also need to running instance of [boned](http://github.com/solutious/boned) (the bone daemon).
|
46
53
|
|
47
|
-
|
54
|
+
|
55
|
+
## More Information
|
48
56
|
|
49
57
|
|
50
|
-
|
58
|
+
## Credits
|
51
59
|
|
52
60
|
* Delano Mandelbaum (http://solutious.com)
|
53
61
|
|
54
62
|
|
55
|
-
|
63
|
+
## Thanks
|
56
64
|
|
57
65
|
* Kalin Harvey for the early feedback.
|
58
66
|
|
59
67
|
|
60
|
-
|
68
|
+
## License
|
61
69
|
|
62
70
|
See LICENSE.txt
|
data/bin/bone
CHANGED
@@ -21,7 +21,7 @@ class Bone::CLI::Definition
|
|
21
21
|
global :t, :token, String, "Specify a bone token (override BONE_TOKEN environment variable)"
|
22
22
|
global :q, :quiet, "Less output"
|
23
23
|
|
24
|
-
global :
|
24
|
+
global :V, :version, "Display version" do
|
25
25
|
puts "Bone: #{Bone::VERSION} (api: #{Bone::APIVERSION})"
|
26
26
|
exit
|
27
27
|
end
|
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.2"
|
11
11
|
APIVERSION = 'v1'.freeze
|
12
12
|
|
13
13
|
class Problem < RuntimeError; end
|
@@ -57,7 +57,8 @@ module Bone
|
|
57
57
|
|
58
58
|
def keys(keyname=nil, opts={})
|
59
59
|
token = opts[:token] || ENV['BONE_TOKEN'] || TOKEN
|
60
|
-
request(:keys, token, keyname, opts)
|
60
|
+
k = request(:keys, token, keyname, opts)
|
61
|
+
k.split($/)
|
61
62
|
end
|
62
63
|
|
63
64
|
# <tt>require</tt> a library from the vendor directory.
|
@@ -96,6 +97,7 @@ module Bone
|
|
96
97
|
srand
|
97
98
|
digest [`hostname`, `w`, Time.now, rand].join(':')
|
98
99
|
end
|
100
|
+
alias_method :token, :generate_token
|
99
101
|
|
100
102
|
private
|
101
103
|
|
@@ -133,6 +135,8 @@ module Bone
|
|
133
135
|
else
|
134
136
|
raise Bone::Problem, "#{res.body} (#{res.code} #{res.message})"
|
135
137
|
end
|
138
|
+
rescue Errno::ECONNREFUSED => ex
|
139
|
+
raise Bone::Problem, "No boned"
|
136
140
|
end
|
137
141
|
|
138
142
|
def determine_digest_type
|
data/try/bone.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# ruby -rubygems -Ilib try/bone.rb
|
2
2
|
require 'bone'
|
3
3
|
|
4
|
-
ENV['BONE_TOKEN'] = '1c397d204aa4e94f566d7f78cc4bb5bef5b558d9bd64c1d8a45e67a621fb87dc'
|
4
|
+
#ENV['BONE_TOKEN'] = '1c397d204aa4e94f566d7f78cc4bb5bef5b558d9bd64c1d8a45e67a621fb87dc'
|
5
5
|
|
6
6
|
Bone['poop'] = rand
|
7
7
|
puts Bone['poop']
|
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.2
|
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:
|
12
|
+
date: 2010-01-08 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|