adapter-riak 0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in adapter-redis.gemspec
4
+ gemspec
5
+
6
+ group(:development) do
7
+ gem 'yajl-ruby'
8
+ gem 'rspec', '~> 2.3'
9
+ gem 'log_buddy', '~> 0.5.0'
10
+ gem 'timecop', '~> 0.3.5'
11
+ gem 'i18n', '0.5.0'
12
+ end
@@ -0,0 +1,44 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ adapter-riak (0.5)
5
+ activesupport (~> 3.0.3)
6
+ adapter (~> 0.5.1)
7
+ riak-client (~> 0.8.3)
8
+
9
+ GEM
10
+ remote: http://rubygems.org/
11
+ specs:
12
+ activesupport (3.0.3)
13
+ adapter (0.5.1)
14
+ builder (2.1.2)
15
+ diff-lcs (1.1.2)
16
+ i18n (0.5.0)
17
+ log_buddy (0.5.0)
18
+ riak-client (0.8.3)
19
+ builder (~> 2.1.2)
20
+ i18n (>= 0.4.0)
21
+ rspec (2.4.0)
22
+ rspec-core (~> 2.4.0)
23
+ rspec-expectations (~> 2.4.0)
24
+ rspec-mocks (~> 2.4.0)
25
+ rspec-core (2.4.0)
26
+ rspec-expectations (2.4.0)
27
+ diff-lcs (~> 1.1.2)
28
+ rspec-mocks (2.4.0)
29
+ timecop (0.3.5)
30
+ yajl-ruby (0.7.9)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ activesupport (~> 3.0.3)
37
+ adapter (~> 0.5.1)
38
+ adapter-riak!
39
+ i18n (= 0.5.0)
40
+ log_buddy (~> 0.5.0)
41
+ riak-client (~> 0.8.3)
42
+ rspec (~> 2.3)
43
+ timecop (~> 0.3.5)
44
+ yajl-ruby
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2010 Newtoy, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ = adapter-riak
2
+
3
+ Riak adapter for adapter gem. Supports read conflicts.
4
+
5
+ See examples/ or specs/ for usage.
6
+
7
+ == Note on Patches/Pull Requests
8
+
9
+ * Fork the project.
10
+ * Make your feature addition or bug fix.
11
+ * Add tests for it. This is important so we don't break it in a future version unintentionally.
12
+ * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine, but bump version in a commit by itself so we can ignore when we pull)
13
+ * Send us a pull request. Bonus points for topic branches.
@@ -0,0 +1,7 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new
6
+
7
+ task :default => :spec
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "adapter/riak/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "adapter-riak"
7
+ s.version = Adapter::Riak::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["John Nunemaker"]
10
+ s.email = ["nunemaker@gmail.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Adapter for riak}
13
+ s.description = %q{Adapter for riak}
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency 'adapter', '~> 0.5.1'
21
+ s.add_dependency 'riak-client', '~> 0.8.3'
22
+ s.add_dependency 'activesupport', '~> 3.0.3'
23
+ end
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ require 'pathname'
3
+
4
+ root_path = Pathname(__FILE__).dirname.join('..').expand_path
5
+ lib_path = root_path.join('lib')
6
+ $:.unshift(lib_path)
7
+
8
+ require 'adapter/riak'
9
+
10
+ client = Riak::Client.new['adapter_example']
11
+ adapter = Adapter[:riak].new(client)
12
+ adapter.clear
13
+
14
+ adapter.write('foo', 'bar')
15
+ puts 'Should be bar: ' + adapter.read('foo').inspect
16
+
17
+ adapter.delete('foo')
18
+ puts 'Should be nil: ' + adapter.read('foo').inspect
19
+
20
+ adapter.write('foo', 'bar')
21
+ adapter.clear
22
+ puts 'Should be nil: ' + adapter.read('foo').inspect
23
+
24
+ puts 'Should be bar: ' + adapter.fetch('foo', 'bar')
25
+ puts 'Should be bar: ' + adapter.read('foo')
@@ -0,0 +1,53 @@
1
+ require 'adapter'
2
+ require 'adapter/riak/conflict'
3
+ require 'riak'
4
+ # present? that comes with riak-client is always
5
+ # returning true and thus always raising read conflicts
6
+ # need this until I can talk to maintainer or fix riak-client
7
+ require 'active_support/core_ext/object/blank'
8
+
9
+ module Adapter
10
+ module Riak
11
+ # Optimize key? to do head request in riak instead of full key read and nil check
12
+ def key?(key)
13
+ client.exists?(key_for(key))
14
+ end
15
+
16
+ def read(key)
17
+ robject = client.get(key_for(key))
18
+ raise Conflict.new(robject) if robject.conflict?
19
+ robject.data
20
+ rescue ::Riak::FailedRequest => e
21
+ e.code.to_i == 404 ? nil : raise(e)
22
+ end
23
+
24
+ def write(key, value)
25
+ key = key_for(key)
26
+ obj = client.get_or_new(key)
27
+ obj.content_type = 'application/json'
28
+ obj.data = value
29
+ obj.store
30
+ value
31
+ end
32
+
33
+ def delete(key)
34
+ read(key).tap { client.delete(key_for(key)) }
35
+ end
36
+
37
+ def clear
38
+ client.keys do |keys|
39
+ keys.each { |key| client.delete(key) }
40
+ end
41
+ end
42
+
43
+ def encode(value)
44
+ value
45
+ end
46
+
47
+ def decode(value)
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ Adapter.define(:riak, Adapter::Riak)
@@ -0,0 +1,12 @@
1
+ module Adapter
2
+ module Riak
3
+ class Conflict < StandardError
4
+ attr_reader :robject
5
+
6
+ def initialize(robject)
7
+ @robject = robject
8
+ super('Read conflict present')
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Adapter
2
+ module Riak
3
+ VERSION = "0.5"
4
+ end
5
+ end
@@ -0,0 +1,544 @@
1
+ # Logfile created on Tue Jan 25 22:34:48 -0500 2011 by logger.rb
2
+ D, [2011-01-25T22:47:15.784512 #65039] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
3
+
4
+ D, [2011-01-25T22:47:15.937098 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
5
+ D, [2011-01-25T22:47:15.990291 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
6
+ D, [2011-01-25T22:47:16.044996 #65039] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
7
+
8
+ D, [2011-01-25T22:47:16.267140 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
9
+ D, [2011-01-25T22:47:16.579649 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
10
+ D, [2011-01-25T22:47:16.635779 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
11
+ D, [2011-01-25T22:47:16.689152 #65039] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
12
+ D, [2011-01-25T22:47:17.142176 #65039] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=TL1NADiyezU6s60MxJPu9GZ6JxJ]:(407 bytes)>
13
+
14
+ D, [2011-01-25T22:47:17.207953 #65039] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=C5U8mpwVE7sSQu3qlNO05WW8NSm]:(407 bytes)>
15
+
16
+ D, [2011-01-25T22:47:41.872444 #65117] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
17
+
18
+ D, [2011-01-25T22:47:41.872591 #65117] DEBUG -- : robject.conflict? = true
19
+
20
+ D, [2011-01-25T22:47:42.021545 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
21
+ D, [2011-01-25T22:47:42.074756 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
22
+ D, [2011-01-25T22:47:42.127817 #65117] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
23
+
24
+ D, [2011-01-25T22:47:42.127969 #65117] DEBUG -- : robject.conflict? = true
25
+
26
+ D, [2011-01-25T22:47:42.284065 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
27
+ D, [2011-01-25T22:47:42.638266 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
28
+ D, [2011-01-25T22:47:42.692943 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
29
+ D, [2011-01-25T22:47:42.746574 #65117] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
30
+ D, [2011-01-25T22:47:43.200565 #65117] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=BXxfCPEubgZ0vuJnNkniTlWp7Ip]:(407 bytes)>
31
+
32
+ D, [2011-01-25T22:47:43.200702 #65117] DEBUG -- : robject.conflict? = true
33
+
34
+ D, [2011-01-25T22:47:43.266500 #65117] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=LVqoKlXJZHSeYgIhrKhE70eSAob]:(407 bytes)>
35
+
36
+ D, [2011-01-25T22:47:43.266654 #65117] DEBUG -- : robject.conflict? = true
37
+
38
+ D, [2011-01-25T22:53:50.314611 #65302] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
39
+
40
+ D, [2011-01-25T22:53:50.314761 #65302] DEBUG -- : robject.data = {"foo"=>"bar"}
41
+
42
+ D, [2011-01-25T22:53:50.314833 #65302] DEBUG -- : robject.conflict? = true
43
+
44
+ D, [2011-01-25T22:53:50.493719 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
45
+ D, [2011-01-25T22:53:50.559335 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
46
+ D, [2011-01-25T22:53:50.624775 #65302] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
47
+
48
+ D, [2011-01-25T22:53:50.625169 #65302] DEBUG -- : robject.data = {"foo"=>"bar"}
49
+
50
+ D, [2011-01-25T22:53:50.625271 #65302] DEBUG -- : robject.conflict? = true
51
+
52
+ D, [2011-01-25T22:53:50.840133 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
53
+ D, [2011-01-25T22:53:51.394248 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
54
+ D, [2011-01-25T22:53:51.470610 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
55
+ D, [2011-01-25T22:53:51.544222 #65302] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
56
+ D, [2011-01-25T22:53:52.001966 #65302] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=A0Yd5VN15fl7d2GKgqyP7SkgdKZ]:(407 bytes)>
57
+
58
+ D, [2011-01-25T22:53:52.002110 #65302] DEBUG -- : robject.data = "
59
+ --A0Yd5VN15fl7d2GKgqyP7SkgdKZ
60
+ Content-Type: application/json
61
+ Link: </riak/adapter_spec>; rel="up"
62
+ Etag: 1Gq7BQPc9WgnFMUXn2a5K5
63
+ Last-Modified: Wed, 26 Jan 2011 03:53:51 GMT
64
+
65
+ "baz"
66
+ --A0Yd5VN15fl7d2GKgqyP7SkgdKZ
67
+ Content-Type: application/json
68
+ Link: </riak/adapter_spec>; rel="up"
69
+ Etag: 5O9fCL8Q7TsOuMScM8KfUA
70
+ Last-Modified: Wed, 26 Jan 2011 03:53:51 GMT
71
+
72
+ "bar"
73
+ --A0Yd5VN15fl7d2GKgqyP7SkgdKZ--
74
+ "
75
+
76
+ D, [2011-01-25T22:53:52.002217 #65302] DEBUG -- : robject.conflict? = true
77
+
78
+ D, [2011-01-25T22:53:52.067832 #65302] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=RRJspMcHAknDz9TclElJyOXSqDc]:(406 bytes)>
79
+
80
+ D, [2011-01-25T22:53:52.067973 #65302] DEBUG -- : robject.data = "
81
+ --RRJspMcHAknDz9TclElJyOXSqDc
82
+ Content-Type: application/json
83
+ Link: </riak/adapter_spec>; rel="up"
84
+ Etag: iFI919UFfOhkwVBmagiUP
85
+ Last-Modified: Wed, 26 Jan 2011 03:53:52 GMT
86
+
87
+ "bar"
88
+ --RRJspMcHAknDz9TclElJyOXSqDc
89
+ Content-Type: application/json
90
+ Link: </riak/adapter_spec>; rel="up"
91
+ Etag: 6H88IZ3GHcSqEdDwNdvMXk
92
+ Last-Modified: Wed, 26 Jan 2011 03:53:52 GMT
93
+
94
+ "baz"
95
+ --RRJspMcHAknDz9TclElJyOXSqDc--
96
+ "
97
+
98
+ D, [2011-01-25T22:53:52.068045 #65302] DEBUG -- : robject.conflict? = true
99
+
100
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:nil>
101
+
102
+ robject.data = {"foo"=>"bar"}
103
+
104
+ robject.conflict? = false
105
+
106
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:nil>
107
+
108
+ robject.data = "value"
109
+
110
+ robject.conflict? = false
111
+
112
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:nil>
113
+
114
+ robject.data = "value"
115
+
116
+ robject.conflict? = false
117
+
118
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:nil>
119
+
120
+ robject.data = {"foo"=>"bar"}
121
+
122
+ robject.conflict? = false
123
+
124
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:nil>
125
+
126
+ robject.data = "value"
127
+
128
+ robject.conflict? = false
129
+
130
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=PtGtKqxfMc23J2gbrrkc0M46n2Q]:nil>
131
+
132
+ robject.data = "
133
+ --PtGtKqxfMc23J2gbrrkc0M46n2Q
134
+ Content-Type: application/json
135
+ Link: </riak/adapter_spec>; rel="up"
136
+ Etag: ZJAyLrSnOIHVnuUizPYZw
137
+ Last-Modified: Wed, 26 Jan 2011 04:13:49 GMT
138
+
139
+ "baz"
140
+ --PtGtKqxfMc23J2gbrrkc0M46n2Q
141
+ Content-Type: application/json
142
+ Link: </riak/adapter_spec>; rel="up"
143
+ Etag: 10KN5o7vWtjzl86iCzkfp2
144
+ Last-Modified: Wed, 26 Jan 2011 04:13:49 GMT
145
+
146
+ "bar"
147
+ --PtGtKqxfMc23J2gbrrkc0M46n2Q--
148
+ "
149
+
150
+ robject.conflict? = true
151
+
152
+ robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=LMFZqZw3zlaijICpx2Ws1Rt9z73]:nil>
153
+
154
+ robject.data = "
155
+ --LMFZqZw3zlaijICpx2Ws1Rt9z73
156
+ Content-Type: application/json
157
+ Link: </riak/adapter_spec>; rel="up"
158
+ Etag: DZ4tDhrjILsyJcLNer9NS
159
+ Last-Modified: Wed, 26 Jan 2011 04:13:49 GMT
160
+
161
+ "baz"
162
+ --LMFZqZw3zlaijICpx2Ws1Rt9z73
163
+ Content-Type: application/json
164
+ Link: </riak/adapter_spec>; rel="up"
165
+ Etag: 4y37gzgMBthDJLCAfwp6SV
166
+ Last-Modified: Wed, 26 Jan 2011 04:13:49 GMT
167
+
168
+ "bar"
169
+ --LMFZqZw3zlaijICpx2Ws1Rt9z73--
170
+ "
171
+
172
+ robject.conflict? = true
173
+
174
+ D, [2011-01-25T23:14:17.977727 #65908] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
175
+
176
+ D, [2011-01-25T23:14:17.977994 #65908] DEBUG -- : robject.data = {"foo"=>"bar"}
177
+
178
+ D, [2011-01-25T23:14:17.978174 #65908] DEBUG -- : robject.conflict? = true
179
+
180
+ D, [2011-01-25T23:14:18.126215 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
181
+ D, [2011-01-25T23:14:18.182008 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
182
+ D, [2011-01-25T23:14:18.236021 #65908] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
183
+
184
+ D, [2011-01-25T23:14:18.236165 #65908] DEBUG -- : robject.data = {"foo"=>"bar"}
185
+
186
+ D, [2011-01-25T23:14:18.236240 #65908] DEBUG -- : robject.conflict? = true
187
+
188
+ D, [2011-01-25T23:14:18.450207 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
189
+ D, [2011-01-25T23:14:18.761181 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
190
+ D, [2011-01-25T23:14:18.815520 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
191
+ D, [2011-01-25T23:14:18.869921 #65908] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
192
+ D, [2011-01-25T23:14:19.310716 #65908] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=KwwJCbWtNpA2EFmOh2TrTI5pri]:(403 bytes)>
193
+
194
+ D, [2011-01-25T23:14:19.310878 #65908] DEBUG -- : robject.data = "
195
+ --KwwJCbWtNpA2EFmOh2TrTI5pri
196
+ Content-Type: application/json
197
+ Link: </riak/adapter_spec>; rel="up"
198
+ Etag: QHt5m2bvoNi2T42GhdFjN
199
+ Last-Modified: Wed, 26 Jan 2011 04:14:19 GMT
200
+
201
+ "baz"
202
+ --KwwJCbWtNpA2EFmOh2TrTI5pri
203
+ Content-Type: application/json
204
+ Link: </riak/adapter_spec>; rel="up"
205
+ Etag: 5COH3zq8hoDDM923S42nHH
206
+ Last-Modified: Wed, 26 Jan 2011 04:14:19 GMT
207
+
208
+ "bar"
209
+ --KwwJCbWtNpA2EFmOh2TrTI5pri--
210
+ "
211
+
212
+ D, [2011-01-25T23:14:19.311022 #65908] DEBUG -- : robject.conflict? = true
213
+
214
+ D, [2011-01-25T23:14:19.430791 #65908] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=G09l9eOYnbVJhZ3Q6IDZqri97SC]:(407 bytes)>
215
+
216
+ D, [2011-01-25T23:14:19.430953 #65908] DEBUG -- : robject.data = "
217
+ --G09l9eOYnbVJhZ3Q6IDZqri97SC
218
+ Content-Type: application/json
219
+ Link: </riak/adapter_spec>; rel="up"
220
+ Etag: 5XRbu9v37nliDSrzwL6WSr
221
+ Last-Modified: Wed, 26 Jan 2011 04:14:19 GMT
222
+
223
+ "bar"
224
+ --G09l9eOYnbVJhZ3Q6IDZqri97SC
225
+ Content-Type: application/json
226
+ Link: </riak/adapter_spec>; rel="up"
227
+ Etag: 2B0FPo1xpYs0LTnyfaPpjV
228
+ Last-Modified: Wed, 26 Jan 2011 04:14:19 GMT
229
+
230
+ "baz"
231
+ --G09l9eOYnbVJhZ3Q6IDZqri97SC--
232
+ "
233
+
234
+ D, [2011-01-25T23:14:19.431101 #65908] DEBUG -- : robject.conflict? = true
235
+
236
+ D, [2011-01-26T00:28:28.278430 #14472] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
237
+
238
+ D, [2011-01-26T00:28:28.278572 #14472] DEBUG -- : robject.data = {"foo"=>"bar"}
239
+
240
+ D, [2011-01-26T00:28:28.278646 #14472] DEBUG -- : robject.conflict? = true
241
+
242
+ D, [2011-01-26T00:28:28.551356 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
243
+ D, [2011-01-26T00:28:28.659068 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
244
+ D, [2011-01-26T00:28:28.788507 #14472] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
245
+
246
+ D, [2011-01-26T00:28:28.788631 #14472] DEBUG -- : robject.data = {"foo"=>"bar"}
247
+
248
+ D, [2011-01-26T00:28:28.788699 #14472] DEBUG -- : robject.conflict? = true
249
+
250
+ D, [2011-01-26T00:28:29.086817 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
251
+ D, [2011-01-26T00:28:29.692377 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
252
+ D, [2011-01-26T00:28:29.817435 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
253
+ D, [2011-01-26T00:28:29.922161 #14472] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
254
+ D, [2011-01-26T00:28:30.756845 #14472] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=R10WQBHgOhmuMST1KqYHO8yR4ai]:(407 bytes)>
255
+
256
+ D, [2011-01-26T00:28:30.756992 #14472] DEBUG -- : robject.data = "
257
+ --R10WQBHgOhmuMST1KqYHO8yR4ai
258
+ Content-Type: application/json
259
+ Link: </riak/adapter_spec>; rel="up"
260
+ Etag: 69H0ytf4eXH029QpFQJdYj
261
+ Last-Modified: Wed, 26 Jan 2011 05:28:30 GMT
262
+
263
+ "baz"
264
+ --R10WQBHgOhmuMST1KqYHO8yR4ai
265
+ Content-Type: application/json
266
+ Link: </riak/adapter_spec>; rel="up"
267
+ Etag: 7MQa7kb4HlVHKA8zCj0F5c
268
+ Last-Modified: Wed, 26 Jan 2011 05:28:30 GMT
269
+
270
+ "bar"
271
+ --R10WQBHgOhmuMST1KqYHO8yR4ai--
272
+ "
273
+
274
+ D, [2011-01-26T00:28:30.757111 #14472] DEBUG -- : robject.conflict? = true
275
+
276
+ D, [2011-01-26T00:28:30.871671 #14472] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=VeQtvl1RdYzHkcE6X1vLPLIkXdj]:(407 bytes)>
277
+
278
+ D, [2011-01-26T00:28:30.871817 #14472] DEBUG -- : robject.data = "
279
+ --VeQtvl1RdYzHkcE6X1vLPLIkXdj
280
+ Content-Type: application/json
281
+ Link: </riak/adapter_spec>; rel="up"
282
+ Etag: 7EgCmatUynwPq3zGDkaevf
283
+ Last-Modified: Wed, 26 Jan 2011 05:28:30 GMT
284
+
285
+ "bar"
286
+ --VeQtvl1RdYzHkcE6X1vLPLIkXdj
287
+ Content-Type: application/json
288
+ Link: </riak/adapter_spec>; rel="up"
289
+ Etag: 6u661VdYBRJc8fVKvIkwNv
290
+ Last-Modified: Wed, 26 Jan 2011 05:28:30 GMT
291
+
292
+ "baz"
293
+ --VeQtvl1RdYzHkcE6X1vLPLIkXdj--
294
+ "
295
+
296
+ D, [2011-01-26T00:28:30.871889 #14472] DEBUG -- : robject.conflict? = true
297
+
298
+ D, [2011-01-26T00:29:09.509423 #14556] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
299
+
300
+ D, [2011-01-26T00:29:09.509562 #14556] DEBUG -- : robject.data = {"foo"=>"bar"}
301
+
302
+ D, [2011-01-26T00:29:09.509635 #14556] DEBUG -- : robject.conflict? = true
303
+
304
+ D, [2011-01-26T00:29:09.773507 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
305
+ D, [2011-01-26T00:29:09.899767 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
306
+ D, [2011-01-26T00:29:09.968508 #14556] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/key [application/json]:{"foo"=>"bar"}>
307
+
308
+ D, [2011-01-26T00:29:09.968772 #14556] DEBUG -- : robject.data = {"foo"=>"bar"}
309
+
310
+ D, [2011-01-26T00:29:09.968908 #14556] DEBUG -- : robject.conflict? = true
311
+
312
+ D, [2011-01-26T00:29:10.261165 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
313
+ D, [2011-01-26T00:29:10.882354 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
314
+ D, [2011-01-26T00:29:10.985355 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value2"'
315
+ D, [2011-01-26T00:29:11.058038 #14556] DEBUG -- : LogBuddy caught an exception: 705: unexpected token at '"value"'
316
+ D, [2011-01-26T00:29:11.927812 #14556] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=YUIQCSIYv1W0wCkffNCNk6lcfkj]:(406 bytes)>
317
+
318
+ D, [2011-01-26T00:29:11.927960 #14556] DEBUG -- : robject.data = "
319
+ --YUIQCSIYv1W0wCkffNCNk6lcfkj
320
+ Content-Type: application/json
321
+ Link: </riak/adapter_spec>; rel="up"
322
+ Etag: 6LnrM1wA1KYb0mmAAObE51
323
+ Last-Modified: Wed, 26 Jan 2011 05:29:11 GMT
324
+
325
+ "bar"
326
+ --YUIQCSIYv1W0wCkffNCNk6lcfkj
327
+ Content-Type: application/json
328
+ Link: </riak/adapter_spec>; rel="up"
329
+ Etag: b3xVF4bpzBLlKAZYQA5yr
330
+ Last-Modified: Wed, 26 Jan 2011 05:29:11 GMT
331
+
332
+ "baz"
333
+ --YUIQCSIYv1W0wCkffNCNk6lcfkj--
334
+ "
335
+
336
+ D, [2011-01-26T00:29:11.928033 #14556] DEBUG -- : robject.conflict? = true
337
+
338
+ D, [2011-01-26T00:29:12.039489 #14556] DEBUG -- : robject = #<Riak::RObject http://127.0.0.1:9000/riak/adapter_spec/foo [multipart/mixed; boundary=WaaDl00ix0vSSVqa99OkW6SY6vm]:(407 bytes)>
339
+
340
+ D, [2011-01-26T00:29:12.039629 #14556] DEBUG -- : robject.data = "
341
+ --WaaDl00ix0vSSVqa99OkW6SY6vm
342
+ Content-Type: application/json
343
+ Link: </riak/adapter_spec>; rel="up"
344
+ Etag: 4HarAceRmOGoZTBhWuI9Io
345
+ Last-Modified: Wed, 26 Jan 2011 05:29:12 GMT
346
+
347
+ "baz"
348
+ --WaaDl00ix0vSSVqa99OkW6SY6vm
349
+ Content-Type: application/json
350
+ Link: </riak/adapter_spec>; rel="up"
351
+ Etag: 1OBsIZlowvrWPMqtFrJMgU
352
+ Last-Modified: Wed, 26 Jan 2011 05:29:12 GMT
353
+
354
+ "bar"
355
+ --WaaDl00ix0vSSVqa99OkW6SY6vm--
356
+ "
357
+
358
+ D, [2011-01-26T00:29:12.039701 #14556] DEBUG -- : robject.conflict? = true
359
+
360
+ D, [2011-01-26T00:39:46.359153 #15880] DEBUG -- : robject.conflict? = true
361
+
362
+ D, [2011-01-26T00:39:46.610087 #15880] DEBUG -- : robject.conflict? = true
363
+
364
+ D, [2011-01-26T00:39:46.737421 #15880] DEBUG -- : robject.conflict? = true
365
+
366
+ D, [2011-01-26T00:39:46.826892 #15880] DEBUG -- : robject.conflict? = true
367
+
368
+ D, [2011-01-26T00:39:47.094448 #15880] DEBUG -- : robject.conflict? = true
369
+
370
+ D, [2011-01-26T00:39:47.672392 #15880] DEBUG -- : robject.conflict? = true
371
+
372
+ D, [2011-01-26T00:39:47.801018 #15880] DEBUG -- : robject.conflict? = true
373
+
374
+ D, [2011-01-26T00:39:47.950149 #15880] DEBUG -- : robject.conflict? = true
375
+
376
+ D, [2011-01-26T00:39:48.680828 #15880] DEBUG -- : robject.conflict? = true
377
+
378
+ D, [2011-01-26T00:39:48.791171 #15880] DEBUG -- : robject.conflict? = true
379
+
380
+ D, [2011-01-26T00:40:14.180073 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
381
+
382
+ D, [2011-01-26T00:40:14.180207 #15976] DEBUG -- : robject.conflict? = true
383
+
384
+ D, [2011-01-26T00:40:14.435302 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
385
+
386
+ D, [2011-01-26T00:40:14.435672 #15976] DEBUG -- : robject.conflict? = true
387
+
388
+ D, [2011-01-26T00:40:14.534702 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
389
+
390
+ D, [2011-01-26T00:40:14.534961 #15976] DEBUG -- : robject.conflict? = true
391
+
392
+ D, [2011-01-26T00:40:14.630747 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
393
+
394
+ D, [2011-01-26T00:40:14.631121 #15976] DEBUG -- : robject.conflict? = true
395
+
396
+ D, [2011-01-26T00:40:14.948692 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
397
+
398
+ D, [2011-01-26T00:40:14.948828 #15976] DEBUG -- : robject.conflict? = true
399
+
400
+ D, [2011-01-26T00:40:15.500589 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
401
+
402
+ D, [2011-01-26T00:40:15.500983 #15976] DEBUG -- : robject.conflict? = true
403
+
404
+ D, [2011-01-26T00:40:15.630144 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
405
+
406
+ D, [2011-01-26T00:40:15.630269 #15976] DEBUG -- : robject.conflict? = true
407
+
408
+ D, [2011-01-26T00:40:15.768322 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
409
+
410
+ D, [2011-01-26T00:40:15.768496 #15976] DEBUG -- : robject.conflict? = true
411
+
412
+ D, [2011-01-26T00:40:16.534502 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
413
+
414
+ D, [2011-01-26T00:40:16.534632 #15976] DEBUG -- : robject.conflict? = true
415
+
416
+ D, [2011-01-26T00:40:16.644604 #15976] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter_spec>
417
+
418
+ D, [2011-01-26T00:40:16.644748 #15976] DEBUG -- : robject.conflict? = true
419
+
420
+ D, [2011-01-26T00:40:48.633267 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
421
+
422
+ D, [2011-01-26T00:40:48.633404 #16078] DEBUG -- : robject.conflict? = true
423
+
424
+ D, [2011-01-26T00:40:48.917448 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
425
+
426
+ D, [2011-01-26T00:40:48.917585 #16078] DEBUG -- : robject.conflict? = true
427
+
428
+ D, [2011-01-26T00:40:49.019068 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
429
+
430
+ D, [2011-01-26T00:40:49.019188 #16078] DEBUG -- : robject.conflict? = true
431
+
432
+ D, [2011-01-26T00:40:49.119558 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
433
+
434
+ D, [2011-01-26T00:40:49.119841 #16078] DEBUG -- : robject.conflict? = true
435
+
436
+ D, [2011-01-26T00:40:49.377493 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
437
+
438
+ D, [2011-01-26T00:40:49.377683 #16078] DEBUG -- : robject.conflict? = true
439
+
440
+ D, [2011-01-26T00:40:49.961093 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
441
+
442
+ D, [2011-01-26T00:40:49.961277 #16078] DEBUG -- : robject.conflict? = true
443
+
444
+ D, [2011-01-26T00:40:50.057357 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
445
+
446
+ D, [2011-01-26T00:40:50.058145 #16078] DEBUG -- : robject.conflict? = true
447
+
448
+ D, [2011-01-26T00:40:50.185511 #16078] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
449
+
450
+ D, [2011-01-26T00:40:50.185671 #16078] DEBUG -- : robject.conflict? = true
451
+
452
+ D, [2011-01-26T00:41:29.281527 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
453
+
454
+ D, [2011-01-26T00:41:29.281659 #16165] DEBUG -- : robject.conflict? = true
455
+
456
+ D, [2011-01-26T00:41:29.543477 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
457
+
458
+ D, [2011-01-26T00:41:29.543715 #16165] DEBUG -- : robject.conflict? = true
459
+
460
+ D, [2011-01-26T00:41:29.639300 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
461
+
462
+ D, [2011-01-26T00:41:29.639576 #16165] DEBUG -- : robject.conflict? = true
463
+
464
+ D, [2011-01-26T00:41:29.737524 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
465
+
466
+ D, [2011-01-26T00:41:29.737773 #16165] DEBUG -- : robject.conflict? = true
467
+
468
+ D, [2011-01-26T00:41:30.051211 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
469
+
470
+ D, [2011-01-26T00:41:30.051372 #16165] DEBUG -- : robject.conflict? = true
471
+
472
+ D, [2011-01-26T00:41:30.635175 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
473
+
474
+ D, [2011-01-26T00:41:30.635300 #16165] DEBUG -- : robject.conflict? = true
475
+
476
+ D, [2011-01-26T00:41:30.736848 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
477
+
478
+ D, [2011-01-26T00:41:30.736969 #16165] DEBUG -- : robject.conflict? = true
479
+
480
+ D, [2011-01-26T00:41:30.918814 #16165] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
481
+
482
+ D, [2011-01-26T00:41:30.918998 #16165] DEBUG -- : robject.conflict? = true
483
+
484
+ D, [2011-01-26T00:41:58.782914 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
485
+
486
+ D, [2011-01-26T00:41:58.783046 #16249] DEBUG -- : robject.conflict? = true
487
+
488
+ D, [2011-01-26T00:41:59.037634 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
489
+
490
+ D, [2011-01-26T00:41:59.037880 #16249] DEBUG -- : robject.conflict? = true
491
+
492
+ D, [2011-01-26T00:41:59.136586 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
493
+
494
+ D, [2011-01-26T00:41:59.136885 #16249] DEBUG -- : robject.conflict? = true
495
+
496
+ D, [2011-01-26T00:41:59.235531 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
497
+
498
+ D, [2011-01-26T00:41:59.235667 #16249] DEBUG -- : robject.conflict? = true
499
+
500
+ D, [2011-01-26T00:41:59.523191 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
501
+
502
+ D, [2011-01-26T00:41:59.523328 #16249] DEBUG -- : robject.conflict? = true
503
+
504
+ D, [2011-01-26T00:42:00.123875 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
505
+
506
+ D, [2011-01-26T00:42:00.124022 #16249] DEBUG -- : robject.conflict? = true
507
+
508
+ D, [2011-01-26T00:42:00.258431 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
509
+
510
+ D, [2011-01-26T00:42:00.258551 #16249] DEBUG -- : robject.conflict? = true
511
+
512
+ D, [2011-01-26T00:42:00.360675 #16249] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
513
+
514
+ D, [2011-01-26T00:42:00.360805 #16249] DEBUG -- : robject.conflict? = true
515
+
516
+ D, [2011-01-26T00:42:13.817392 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
517
+
518
+ D, [2011-01-26T00:42:13.817523 #16330] DEBUG -- : robject.conflict? = true
519
+
520
+ D, [2011-01-26T00:42:14.075182 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
521
+
522
+ D, [2011-01-26T00:42:14.075420 #16330] DEBUG -- : robject.conflict? = true
523
+
524
+ D, [2011-01-26T00:42:14.173224 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
525
+
526
+ D, [2011-01-26T00:42:14.173568 #16330] DEBUG -- : robject.conflict? = true
527
+
528
+ D, [2011-01-26T00:42:14.271677 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
529
+
530
+ D, [2011-01-26T00:42:14.271954 #16330] DEBUG -- : robject.conflict? = true
531
+
532
+ D, [2011-01-26T00:42:14.585660 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
533
+
534
+ D, [2011-01-26T00:42:14.585921 #16330] DEBUG -- : robject.conflict? = true
535
+
536
+ D, [2011-01-26T00:42:15.151859 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
537
+
538
+ D, [2011-01-26T00:42:15.152152 #16330] DEBUG -- : robject.conflict? = true
539
+
540
+ D, [2011-01-26T00:42:15.297257 #16330] DEBUG -- : robject.bucket = #<Riak::Bucket http://127.0.0.1:9000/riak/adapter2_spec>
541
+
542
+ D, [2011-01-26T00:42:15.297377 #16330] DEBUG -- : robject.conflict? = true
543
+
544
+ D, [2011-01-26T00:42:15.523324 #16330] DEBUG -- : LogBuddy caught an exception: private method `split' called for nil:NilClass
@@ -0,0 +1,31 @@
1
+ $:.unshift(File.expand_path('../../lib', __FILE__))
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+
6
+ Bundler.require(:default, :development)
7
+
8
+ require 'pathname'
9
+ require 'logger'
10
+
11
+ root_path = Pathname(__FILE__).dirname.join('..').expand_path
12
+ lib_path = root_path.join('lib')
13
+ log_path = root_path.join('log')
14
+ log_path.mkpath
15
+
16
+ require 'adapter/spec/an_adapter'
17
+ require 'adapter/spec/marshal_adapter'
18
+ require 'adapter/spec/json_adapter'
19
+ require 'adapter/spec/types'
20
+
21
+ require 'riak'
22
+ require 'support/test_server'
23
+
24
+ logger = Logger.new(log_path.join('test.log'))
25
+ LogBuddy.init(:logger => logger)
26
+
27
+ Rspec.configure do |c|
28
+ c.before(:each) do
29
+ $test_server.recycle
30
+ end
31
+ end
@@ -0,0 +1,40 @@
1
+ require 'helper'
2
+ require 'adapter/riak'
3
+
4
+ describe "Riak adapter" do
5
+ before(:each) do
6
+ @client = Riak::Client.new(:port => 9000)['adapter_spec']
7
+ @client.allow_mult = false
8
+ @adapter = Adapter[:riak].new(@client)
9
+ @adapter.clear
10
+ end
11
+
12
+ let(:adapter) { @adapter }
13
+ let(:client) { @client }
14
+
15
+ it_should_behave_like 'a json adapter'
16
+
17
+ describe "reading key with conflicts" do
18
+ before(:each) do
19
+ client.allow_mult = true
20
+ other_adapter = Adapter[:riak].new(Riak::Client.new(:port => 9000)['adapter_spec'])
21
+
22
+ threads = []
23
+ threads << Thread.new { adapter.write('foo', 'bar') }
24
+ threads << Thread.new { other_adapter.write('foo', 'baz') }
25
+ threads.each(&:join)
26
+ end
27
+
28
+ it "raises conflict error" do
29
+ lambda { adapter.read('foo') }.should raise_error(Adapter::Riak::Conflict)
30
+ end
31
+
32
+ it "exposes robject to exception" do
33
+ begin
34
+ adapter.read('foo')
35
+ rescue Adapter::Riak::Conflict => e
36
+ e.robject.should be_instance_of(Riak::RObject)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,12 @@
1
+ begin
2
+ $test_server = Riak::TestServer.new({
3
+ :bin_dir => File.dirname(`which riak`),
4
+ })
5
+ $test_server.prepare!
6
+ $test_server.start
7
+ at_exit { $test_server.cleanup }
8
+ rescue => e
9
+ warn "Can't run Riak::TestServer!"
10
+ warn e.inspect
11
+ exit
12
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adapter-riak
3
+ version: !ruby/object:Gem::Version
4
+ hash: 1
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 5
9
+ version: "0.5"
10
+ platform: ruby
11
+ authors:
12
+ - John Nunemaker
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-26 00:00:00 -05:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: adapter
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 9
29
+ segments:
30
+ - 0
31
+ - 5
32
+ - 1
33
+ version: 0.5.1
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: riak-client
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ hash: 57
45
+ segments:
46
+ - 0
47
+ - 8
48
+ - 3
49
+ version: 0.8.3
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: activesupport
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ hash: 1
61
+ segments:
62
+ - 3
63
+ - 0
64
+ - 3
65
+ version: 3.0.3
66
+ type: :runtime
67
+ version_requirements: *id003
68
+ description: Adapter for riak
69
+ email:
70
+ - nunemaker@gmail.com
71
+ executables: []
72
+
73
+ extensions: []
74
+
75
+ extra_rdoc_files: []
76
+
77
+ files:
78
+ - .gitignore
79
+ - Gemfile
80
+ - Gemfile.lock
81
+ - LICENSE
82
+ - README.rdoc
83
+ - Rakefile
84
+ - adapter-riak.gemspec
85
+ - examples/riak.rb
86
+ - lib/adapter/riak.rb
87
+ - lib/adapter/riak/conflict.rb
88
+ - lib/adapter/riak/version.rb
89
+ - log/test.log
90
+ - spec/helper.rb
91
+ - spec/riak_spec.rb
92
+ - spec/support/test_server.rb
93
+ has_rdoc: true
94
+ homepage: ""
95
+ licenses: []
96
+
97
+ post_install_message:
98
+ rdoc_options: []
99
+
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
110
+ version: "0"
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ hash: 3
117
+ segments:
118
+ - 0
119
+ version: "0"
120
+ requirements: []
121
+
122
+ rubyforge_project:
123
+ rubygems_version: 1.3.7
124
+ signing_key:
125
+ specification_version: 3
126
+ summary: Adapter for riak
127
+ test_files:
128
+ - spec/helper.rb
129
+ - spec/riak_spec.rb
130
+ - spec/support/test_server.rb