rico 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/README.md +5 -4
- data/lib/rico.rb +8 -4
- data/lib/rico/array.rb +2 -1
- data/lib/rico/resolver.rb +1 -1
- data/lib/rico/version.rb +1 -1
- data/rico.gemspec +2 -0
- data/spec/rico_spec.rb +3 -4
- data/spec/spec_helper.rb +0 -1
- metadata +18 -1
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Rico
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/jcoene/rico.png?branch=master)](https://travis-ci.org/jcoene/rico)
|
4
|
+
|
3
5
|
Rico provides primative data types on Riak.
|
4
6
|
|
5
7
|
## Installation
|
@@ -34,11 +36,11 @@ follows.length # => 0
|
|
34
36
|
|
35
37
|
## Configuration
|
36
38
|
|
37
|
-
By default, Rico uses a generic Riak::Client instance for operations. You can specify your own (perhaps inside of a rails initializer) like so:
|
39
|
+
By default, Rico uses a generic Riak::Client instance for operations. You can specify your own options for the Riak client (perhaps inside of a rails initializer) like so:
|
38
40
|
|
39
41
|
```ruby
|
40
42
|
Rico.configure do |c|
|
41
|
-
c.
|
43
|
+
c.options = { http_port: 1234, ... }
|
42
44
|
end
|
43
45
|
```
|
44
46
|
|
@@ -116,8 +118,7 @@ Data is persisted at operation time. For example, List#add(5) will immediately u
|
|
116
118
|
|
117
119
|
## TODO
|
118
120
|
|
119
|
-
-
|
120
|
-
- Ability to provide sibling resolution callback
|
121
|
+
- Ability to provide custom sibling resolution callbacks
|
121
122
|
|
122
123
|
## Contributing
|
123
124
|
|
data/lib/rico.rb
CHANGED
@@ -40,12 +40,16 @@ module Rico
|
|
40
40
|
@namespace = namespace
|
41
41
|
end
|
42
42
|
|
43
|
-
def self.
|
44
|
-
@
|
43
|
+
def self.options
|
44
|
+
@options || {}
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.options=(options)
|
48
|
+
@options = options
|
45
49
|
end
|
46
50
|
|
47
|
-
def self.riak
|
48
|
-
|
51
|
+
def self.riak
|
52
|
+
Thread.current[:riak] ||= Riak::Client.new(options)
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
data/lib/rico/array.rb
CHANGED
data/lib/rico/resolver.rb
CHANGED
data/lib/rico/version.rb
CHANGED
data/rico.gemspec
CHANGED
@@ -16,6 +16,8 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = Rico::VERSION
|
17
17
|
|
18
18
|
gem.add_dependency "riak-client", "~> 1.1"
|
19
|
+
|
20
|
+
gem.add_development_dependency "rake", "~> 10.0"
|
19
21
|
gem.add_development_dependency "rspec", "~> 2.12"
|
20
22
|
gem.add_development_dependency "guard-rspec", "~> 2.3"
|
21
23
|
end
|
data/spec/rico_spec.rb
CHANGED
@@ -14,13 +14,12 @@ describe Rico do
|
|
14
14
|
Rico.namespace.should eql "myapp"
|
15
15
|
end
|
16
16
|
|
17
|
-
it "accepts a
|
18
|
-
riak = Riak::Client.new
|
17
|
+
it "accepts a hash of options" do
|
19
18
|
Rico.configure do |r|
|
20
|
-
r.
|
19
|
+
r.options = { http_port: 5151 }
|
21
20
|
end
|
22
21
|
|
23
|
-
Rico.
|
22
|
+
Rico.options.should eql({ http_port: 5151 })
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.1'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '10.0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '10.0'
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: rspec
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,6 +84,7 @@ extra_rdoc_files: []
|
|
68
84
|
files:
|
69
85
|
- .gitignore
|
70
86
|
- .rspec
|
87
|
+
- .travis.yml
|
71
88
|
- Gemfile
|
72
89
|
- Guardfile
|
73
90
|
- LICENSE
|