riaktor 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +11 -0
- data/PostInstall.txt +4 -0
- data/README.rdoc +70 -0
- data/Rakefile +30 -0
- data/lib/riaktor.rb +25 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_helper.rb +24 -0
- data/test/test_riaktor.rb +312 -0
- metadata +192 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
= Riaktor
|
2
|
+
|
3
|
+
* http://github.com/benmyles/riaktor
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Riaktor is a Ruby client and object mapper for Riak (http://riak.basho.com/).
|
8
|
+
It's brand new and probably has bugs, but feel free to try it out.
|
9
|
+
|
10
|
+
== FEATURES/PROBLEMS:
|
11
|
+
|
12
|
+
* Fast: all GETs are concurrent, support for concurrent PUTs and DELETEs.
|
13
|
+
Operations like find_many on a document make this transparent.
|
14
|
+
|
15
|
+
* Attributes: split your document up into attributes so that you reduce the
|
16
|
+
chance of conflicts and better spread out your data.
|
17
|
+
|
18
|
+
* Indexes: create basic, arbitrary indexes on your Riak objects with one line.
|
19
|
+
|
20
|
+
* Associations: define associations with one line. Uses the Riak links feature
|
21
|
+
so that you'll be able to do easy map reduce functions. Also supports paging
|
22
|
+
through your association members so that you don't need to load them all
|
23
|
+
at once.
|
24
|
+
|
25
|
+
== SYNOPSIS:
|
26
|
+
|
27
|
+
See tests. Better documentation coming soon to the Wiki.
|
28
|
+
|
29
|
+
== REQUIREMENTS:
|
30
|
+
|
31
|
+
* Ruby 1.9+
|
32
|
+
* Rails 3.0 beta (Riaktor doesn't care if it's used within a Rails project or not
|
33
|
+
but it does rely on Active Model and Active Support).
|
34
|
+
|
35
|
+
== INSTALL:
|
36
|
+
|
37
|
+
$ gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
|
38
|
+
$ gem install rails --pre
|
39
|
+
$ gem install riaktor
|
40
|
+
|
41
|
+
== LINKS:
|
42
|
+
|
43
|
+
* Documentation: http://wiki.github.com/benmyles/riaktor/
|
44
|
+
* Email: ben dot myles at gmail dot com
|
45
|
+
* Twitter: benmyles
|
46
|
+
|
47
|
+
== LICENSE:
|
48
|
+
|
49
|
+
(The MIT License)
|
50
|
+
|
51
|
+
Copyright (c) 2010 Ben Myles
|
52
|
+
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
54
|
+
a copy of this software and associated documentation files (the
|
55
|
+
'Software'), to deal in the Software without restriction, including
|
56
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
57
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
58
|
+
permit persons to whom the Software is furnished to do so, subject to
|
59
|
+
the following conditions:
|
60
|
+
|
61
|
+
The above copyright notice and this permission notice shall be
|
62
|
+
included in all copies or substantial portions of the Software.
|
63
|
+
|
64
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
65
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
66
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
67
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
68
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
69
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
70
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/riaktor'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'riaktor' do
|
14
|
+
self.developer 'Ben Myles', 'ben.myles@gmail.com'
|
15
|
+
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
|
+
self.rubyforge_name = self.name # TODO this is default value
|
17
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
18
|
+
self.extra_deps = [ ['typhoeus',"= 0.1.22"],
|
19
|
+
['uuidtools','= 2.1.1'],
|
20
|
+
['yajl-ruby', '= 0.7.4'],
|
21
|
+
['activesupport', '= 3.0.0.beta'],
|
22
|
+
["activemodel", '= 3.0.0.beta'] ]
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'newgem/tasks'
|
26
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
27
|
+
|
28
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
29
|
+
# remove_task :default
|
30
|
+
# task :default => [:spec, :features]
|
data/lib/riaktor.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
gem "typhoeus", "= 0.1.22"
|
5
|
+
require "typhoeus"
|
6
|
+
|
7
|
+
gem 'uuidtools','= 2.1.1'
|
8
|
+
require 'uuidtools'
|
9
|
+
|
10
|
+
gem 'yajl-ruby', '= 0.7.4'
|
11
|
+
require 'yajl'
|
12
|
+
|
13
|
+
gem "activesupport", '= 3.0.0.beta'
|
14
|
+
require "active_support/all"
|
15
|
+
|
16
|
+
gem "activemodel", '= 3.0.0.beta'
|
17
|
+
require "active_model"
|
18
|
+
|
19
|
+
module Riaktor
|
20
|
+
VERSION = '0.0.1'
|
21
|
+
end
|
22
|
+
|
23
|
+
require "#{File.dirname(__FILE__)}/riaktor/client"
|
24
|
+
require "#{File.dirname(__FILE__)}/riaktor/r_object"
|
25
|
+
require "#{File.dirname(__FILE__)}/riaktor/document"
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/riaktor.rb'}"
|
9
|
+
puts "Loading riaktor gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'stringio'
|
2
|
+
require 'test/unit'
|
3
|
+
require File.dirname(__FILE__) + '/../lib/riaktor'
|
4
|
+
|
5
|
+
class Person < Riaktor::Document::Base
|
6
|
+
attribute :occupation
|
7
|
+
attribute :age
|
8
|
+
attribute :updated_at
|
9
|
+
attribute :phone_number
|
10
|
+
|
11
|
+
index :phone_number
|
12
|
+
|
13
|
+
association :friends, :class => :person
|
14
|
+
|
15
|
+
validates_presence_of :age
|
16
|
+
|
17
|
+
before_save :set_updated_at
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def set_updated_at
|
22
|
+
self.updated_at.value = Time.now.utc
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,312 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestRiaktor < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_document
|
9
|
+
if p = Person.find("ben")
|
10
|
+
assert p.destroy
|
11
|
+
sleep(0.01)
|
12
|
+
assert_nil Person.find("ben")
|
13
|
+
end
|
14
|
+
|
15
|
+
p = Person.new
|
16
|
+
p.key = "ben"
|
17
|
+
p.value = "Ben Myles"
|
18
|
+
p.age.value = 20
|
19
|
+
assert p.save
|
20
|
+
|
21
|
+
p = Person.find("ben")
|
22
|
+
assert_equal "Ben Myles", p.value
|
23
|
+
p.occupation.value = "something"
|
24
|
+
p.age.value = 26
|
25
|
+
assert p.save
|
26
|
+
|
27
|
+
p = Person.find("ben")
|
28
|
+
assert_equal "something", p.occupation.value
|
29
|
+
assert_equal 26, p.age.value
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_destroy
|
33
|
+
if p = Person.find("test_destroy")
|
34
|
+
assert p.destroy
|
35
|
+
sleep(0.01)
|
36
|
+
assert_nil Person.find("test_destroy")
|
37
|
+
end
|
38
|
+
|
39
|
+
p = Person.new
|
40
|
+
p.key = "test_destroy"
|
41
|
+
p.value = "test_destroy value"
|
42
|
+
p.age.value = 20
|
43
|
+
assert p.save
|
44
|
+
|
45
|
+
assert Person.find("test_destroy")
|
46
|
+
assert Riaktor::Document::Attribute.find(p.age.key, {:bucket => p.bucket})
|
47
|
+
assert p.destroy; sleep(0.01)
|
48
|
+
|
49
|
+
assert_nil Person.find("test_destroy")
|
50
|
+
assert_nil Riaktor::Document::Attribute.find(p.age.key, {:bucket => p.bucket})
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_find_many
|
54
|
+
keys = []
|
55
|
+
1.upto(25) do |i|
|
56
|
+
if p = Person.find("person#{i}")
|
57
|
+
p.destroy; sleep(0.01)
|
58
|
+
end
|
59
|
+
p = Person.new(:key => "person#{i}", :value => "value#{i}")
|
60
|
+
p.age.value = i
|
61
|
+
assert p.save
|
62
|
+
keys << p.key
|
63
|
+
end
|
64
|
+
results = Person.find_many(keys)
|
65
|
+
1.upto(25) do |i|
|
66
|
+
p = results["person#{i}"]
|
67
|
+
assert_equal "value#{i}", p.value
|
68
|
+
assert_equal i, p.age.value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_save_many_and_destroy_many
|
73
|
+
keys = []
|
74
|
+
1.upto(25) { |i| keys << "person#{i}" }
|
75
|
+
if people = Person.find_many(keys) and !people.empty?
|
76
|
+
results = Person.destroy_many(people.collect { |k,v| v })
|
77
|
+
results.each { |k,v| assert v == true }
|
78
|
+
end; sleep(0.01)
|
79
|
+
|
80
|
+
docs = []
|
81
|
+
|
82
|
+
1.upto(25) do |i|
|
83
|
+
assert_nil Person.find("person#{i}")
|
84
|
+
p = Person.new(:key => "person#{i}", :value => "value#{i}")
|
85
|
+
p.age.value = i
|
86
|
+
docs << p
|
87
|
+
end
|
88
|
+
|
89
|
+
results = Person.save_many(docs)
|
90
|
+
results.each { |doc,res| assert res == true }
|
91
|
+
|
92
|
+
1.upto(25) do |i|
|
93
|
+
p = Person.find("person#{i}")
|
94
|
+
assert_equal "value#{i}", p.value
|
95
|
+
assert_equal i, p.age.value
|
96
|
+
end
|
97
|
+
|
98
|
+
keys = []
|
99
|
+
1.upto(25) { |i| keys << "person#{i}" }
|
100
|
+
if people = Person.find_many(keys) and !people.empty?
|
101
|
+
results = Person.destroy_many(people.collect { |k,v| v })
|
102
|
+
results.each { |k,v| assert v == true }
|
103
|
+
end
|
104
|
+
|
105
|
+
sleep(0.01)
|
106
|
+
|
107
|
+
1.upto(25) do |i|
|
108
|
+
assert_nil Person.find("person#{i}")
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_validations
|
113
|
+
p = Person.new(:key => "test_validations")
|
114
|
+
assert !p.save
|
115
|
+
assert_equal({:age=>["can't be blank"]}, p.errors)
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_non_unique_key
|
119
|
+
unless p = Person.find("ben")
|
120
|
+
p = Person.new
|
121
|
+
p.key = "ben"
|
122
|
+
p.value = "Ben Myles"
|
123
|
+
p.age.value = 20
|
124
|
+
assert p.save
|
125
|
+
end
|
126
|
+
|
127
|
+
p = Person.new(:key => "ben")
|
128
|
+
assert !p.save
|
129
|
+
assert_equal({:key=>["is not unique"]}, p.errors)
|
130
|
+
end
|
131
|
+
|
132
|
+
def test_cannot_save_attributes_if_doc_is_not_valid
|
133
|
+
unless p = Person.find("ben")
|
134
|
+
p = Person.new
|
135
|
+
p.key = "ben"
|
136
|
+
p.value = "Ben Myles"
|
137
|
+
p.age.value = 20
|
138
|
+
assert p.save
|
139
|
+
end
|
140
|
+
|
141
|
+
p.occupation.value = "engineer"
|
142
|
+
assert p.occupation.save
|
143
|
+
assert p.valid?
|
144
|
+
p.age.value = nil
|
145
|
+
assert !p.valid?
|
146
|
+
assert !p.occupation.save
|
147
|
+
end
|
148
|
+
|
149
|
+
def test_callbacks
|
150
|
+
unless p = Person.find("ben")
|
151
|
+
p = Person.new
|
152
|
+
p.key = "ben"
|
153
|
+
p.value = "Ben Myles"
|
154
|
+
p.age.value = 20
|
155
|
+
end
|
156
|
+
assert p.save
|
157
|
+
assert p.updated_at.value.is_a?(Time)
|
158
|
+
t1 = p.updated_at.value
|
159
|
+
assert p.save
|
160
|
+
assert p.updated_at.value.is_a?(Time)
|
161
|
+
assert p.updated_at.value > t1
|
162
|
+
end
|
163
|
+
|
164
|
+
def test_siblings
|
165
|
+
props = Riaktor::Client.bucket_props("person")
|
166
|
+
props["props"]["allow_mult"] = true
|
167
|
+
assert Riaktor::Client.set_bucket_props("person", props)
|
168
|
+
props = Riaktor::Client.bucket_props("person")
|
169
|
+
assert props["props"]["allow_mult"] == true
|
170
|
+
|
171
|
+
if p = Person.find("test_siblings")
|
172
|
+
assert p.resolved!
|
173
|
+
assert p.age.resolved!
|
174
|
+
assert p.updated_at.resolved!
|
175
|
+
assert p.destroy
|
176
|
+
sleep(0.1)
|
177
|
+
assert_nil Person.find("test_siblings")
|
178
|
+
end
|
179
|
+
|
180
|
+
Riaktor::Client.client_id = "client1"
|
181
|
+
unless client1_p = Person.find("test_siblings")
|
182
|
+
client1_p = Person.new
|
183
|
+
client1_p.key = "test_siblings"
|
184
|
+
client1_p.value = "client1 value"
|
185
|
+
client1_p.age.value = 20
|
186
|
+
end
|
187
|
+
assert client1_p.save
|
188
|
+
|
189
|
+
client2_p = Person.find("test_siblings")
|
190
|
+
assert_equal 20, client2_p.age.value
|
191
|
+
assert_equal "client1 value", client2_p.value
|
192
|
+
|
193
|
+
Riaktor::Client.client_id = "client1"
|
194
|
+
client1_p.value = "client1 value II"
|
195
|
+
client1_p.age.value = 21
|
196
|
+
assert client1_p.save
|
197
|
+
|
198
|
+
Riaktor::Client.client_id = "client2"
|
199
|
+
client2_p.value = "client2 value"
|
200
|
+
client2_p.age.value = 22
|
201
|
+
assert client2_p.save
|
202
|
+
|
203
|
+
assert_equal 2, client2_p.siblings.keys.size
|
204
|
+
assert_equal 2, client2_p.age.siblings.keys.size
|
205
|
+
assert_equal 2, client2_p.updated_at.siblings.keys.size
|
206
|
+
assert client2_p.in_conflict?
|
207
|
+
client2_p.value = "client2 value"
|
208
|
+
client2_p.resolved!
|
209
|
+
assert client2_p.in_conflict?
|
210
|
+
client2_p.age.value = 23
|
211
|
+
client2_p.age.resolved!
|
212
|
+
client2_p.updated_at.resolved!
|
213
|
+
assert !client2_p.in_conflict?
|
214
|
+
assert client2_p.save
|
215
|
+
|
216
|
+
p = Person.find("test_siblings")
|
217
|
+
assert_equal "client2 value", p.value
|
218
|
+
assert_equal 23, p.age.value
|
219
|
+
end
|
220
|
+
|
221
|
+
def test_indexes
|
222
|
+
if p = Person.find("test_indexes")
|
223
|
+
assert p.destroy
|
224
|
+
end
|
225
|
+
|
226
|
+
p = Person.new(:key => "test_indexes")
|
227
|
+
p.value = "Ben Myles"
|
228
|
+
p.age.value = 26
|
229
|
+
p.phone_number.value = "555-444-5555"
|
230
|
+
assert p.save
|
231
|
+
|
232
|
+
p = Person.find_with_index(:phone_number, "555-444-5555")
|
233
|
+
assert p
|
234
|
+
assert_equal "555-444-5555", p.phone_number.value
|
235
|
+
p.phone_number.value = "555-555-5555"
|
236
|
+
assert p.save
|
237
|
+
assert_nil Person.find_with_index(:phone_number, "555-444-5555")
|
238
|
+
p = Person.find_with_index(:phone_number, "555-555-5555")
|
239
|
+
assert p
|
240
|
+
assert p.destroy
|
241
|
+
assert_nil Person.find_with_index(:phone_number, "555-444-5555")
|
242
|
+
end
|
243
|
+
|
244
|
+
def test_links
|
245
|
+
["test_links_ben","test_links_chris", "test_links_sean"].each do |key|
|
246
|
+
if p = Person.find(key)
|
247
|
+
p.destroy
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
ben = Person.new(:key => "test_links_ben")
|
252
|
+
ben.value = "Ben"
|
253
|
+
ben.age.value = 26
|
254
|
+
ben.phone_number.value = "555-444-5555"
|
255
|
+
assert ben.save
|
256
|
+
ben.age.value = 25
|
257
|
+
assert ben.save
|
258
|
+
|
259
|
+
chris = Person.new(:key => "test_links_chris")
|
260
|
+
chris.value = "Chris"
|
261
|
+
chris.age.value = 26
|
262
|
+
chris.phone_number.value = "555-555-5555"
|
263
|
+
assert chris.save
|
264
|
+
|
265
|
+
sean = Person.new(:key => "test_links_sean")
|
266
|
+
sean.value = "Sean"
|
267
|
+
sean.age.value = 26
|
268
|
+
sean.phone_number.value = "123-555-5555"
|
269
|
+
assert sean.save
|
270
|
+
|
271
|
+
assert_equal [], ben.links
|
272
|
+
assert_equal [], ben.friends.members
|
273
|
+
assert ben.friends << chris
|
274
|
+
assert_equal 1, ben.friends.members.size
|
275
|
+
assert_equal 1, ben.links.size
|
276
|
+
|
277
|
+
ben = Person.find("test_links_ben")
|
278
|
+
assert_equal [], ben.links
|
279
|
+
assert_equal [], ben.friends.members
|
280
|
+
assert ben.friends << chris
|
281
|
+
assert_equal 1, ben.friends.members.size
|
282
|
+
assert_equal 1, ben.links.size
|
283
|
+
assert ben.friends.save
|
284
|
+
|
285
|
+
ben = Person.find("test_links_ben")
|
286
|
+
assert_equal 1, ben.friends.members.size
|
287
|
+
assert_equal 1, ben.links.size
|
288
|
+
assert_equal chris, ben.friends.members.first
|
289
|
+
|
290
|
+
ben.friends << sean
|
291
|
+
assert ben.friends.save
|
292
|
+
assert_equal 2, ben.friends.members.size
|
293
|
+
assert_equal 2, ben.links.size
|
294
|
+
assert_equal chris, ben.friends.members.first
|
295
|
+
ben = Person.find("test_links_ben")
|
296
|
+
assert_equal 2, ben.friends.members.size
|
297
|
+
assert_equal 2, ben.links.size
|
298
|
+
assert_equal chris, ben.friends.members.first
|
299
|
+
assert_equal [chris], ben.friends.members(0,0)
|
300
|
+
assert_equal [sean], ben.friends.members(1,1)
|
301
|
+
assert_equal [chris,sean], ben.friends.members
|
302
|
+
|
303
|
+
assert ben.friends.remove(chris)
|
304
|
+
assert_equal 1, ben.links.size
|
305
|
+
assert_equal 1, ben.friends.members.size
|
306
|
+
assert ben.friends.save
|
307
|
+
|
308
|
+
ben = Person.find("test_links_ben")
|
309
|
+
assert_equal 1, ben.links.size
|
310
|
+
assert_equal 1, ben.friends.members.size
|
311
|
+
end
|
312
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: riaktor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Ben Myles
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-03-18 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: typhoeus
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 1
|
30
|
+
- 22
|
31
|
+
version: 0.1.22
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: uuidtools
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 2
|
43
|
+
- 1
|
44
|
+
- 1
|
45
|
+
version: 2.1.1
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: yajl-ruby
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 7
|
58
|
+
- 4
|
59
|
+
version: 0.7.4
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: activesupport
|
64
|
+
prerelease: false
|
65
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 3
|
71
|
+
- 0
|
72
|
+
- 0
|
73
|
+
- beta
|
74
|
+
version: 3.0.0.beta
|
75
|
+
type: :runtime
|
76
|
+
version_requirements: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: activemodel
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - "="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
segments:
|
85
|
+
- 3
|
86
|
+
- 0
|
87
|
+
- 0
|
88
|
+
- beta
|
89
|
+
version: 3.0.0.beta
|
90
|
+
type: :runtime
|
91
|
+
version_requirements: *id005
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rubyforge
|
94
|
+
prerelease: false
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 2
|
101
|
+
- 0
|
102
|
+
- 4
|
103
|
+
version: 2.0.4
|
104
|
+
type: :development
|
105
|
+
version_requirements: *id006
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
name: gemcutter
|
108
|
+
prerelease: false
|
109
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
segments:
|
114
|
+
- 0
|
115
|
+
- 5
|
116
|
+
- 0
|
117
|
+
version: 0.5.0
|
118
|
+
type: :development
|
119
|
+
version_requirements: *id007
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: hoe
|
122
|
+
prerelease: false
|
123
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
segments:
|
128
|
+
- 2
|
129
|
+
- 5
|
130
|
+
- 0
|
131
|
+
version: 2.5.0
|
132
|
+
type: :development
|
133
|
+
version_requirements: *id008
|
134
|
+
description: |-
|
135
|
+
Riaktor is a Ruby client and object mapper for Riak (http://riak.basho.com/).
|
136
|
+
It's brand new and probably has bugs, but feel free to try it out.
|
137
|
+
email:
|
138
|
+
- ben.myles@gmail.com
|
139
|
+
executables: []
|
140
|
+
|
141
|
+
extensions: []
|
142
|
+
|
143
|
+
extra_rdoc_files:
|
144
|
+
- History.txt
|
145
|
+
- Manifest.txt
|
146
|
+
- PostInstall.txt
|
147
|
+
files:
|
148
|
+
- History.txt
|
149
|
+
- Manifest.txt
|
150
|
+
- PostInstall.txt
|
151
|
+
- README.rdoc
|
152
|
+
- Rakefile
|
153
|
+
- lib/riaktor.rb
|
154
|
+
- script/console
|
155
|
+
- script/destroy
|
156
|
+
- script/generate
|
157
|
+
- test/test_helper.rb
|
158
|
+
- test/test_riaktor.rb
|
159
|
+
has_rdoc: true
|
160
|
+
homepage: http://github.com/benmyles/riaktor
|
161
|
+
licenses: []
|
162
|
+
|
163
|
+
post_install_message: PostInstall.txt
|
164
|
+
rdoc_options:
|
165
|
+
- --main
|
166
|
+
- README.rdoc
|
167
|
+
require_paths:
|
168
|
+
- lib
|
169
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
version: "0"
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
segments:
|
181
|
+
- 0
|
182
|
+
version: "0"
|
183
|
+
requirements: []
|
184
|
+
|
185
|
+
rubyforge_project: riaktor
|
186
|
+
rubygems_version: 1.3.6
|
187
|
+
signing_key:
|
188
|
+
specification_version: 3
|
189
|
+
summary: Riaktor is a Ruby client and object mapper for Riak (http://riak.basho.com/)
|
190
|
+
test_files:
|
191
|
+
- test/test_helper.rb
|
192
|
+
- test/test_riaktor.rb
|