couchbase-jruby-client 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couchbase.rb +1 -1
- data/lib/couchbase/design_doc.rb +6 -1
- data/lib/couchbase/operations/design_docs.rb +4 -4
- data/lib/couchbase/query.rb +13 -13
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase/view.rb +3 -3
- data/test/test_store.rb +0 -1
- metadata +2 -4
- data/lib/couchbase/jruby/couchbase_client.rb +0 -22
- data/lib/couchbase/jruby/future.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7083d15093935a06d4e97e63ba51002d380017c
|
4
|
+
data.tar.gz: 276b3d3e2a9a5234accd1137408ad9e6f04a6941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee1b9dc433b9765a2ab46c09a2fc18cfc55319696d5f7253783ecbd5371c02090e2501951af4d6b5d82a4ec9ea6a7512b6e1d4f56b358d7958e15d8d3c82e7e
|
7
|
+
data.tar.gz: c10067130e72f705671fccd0b032ae9707ce26d24e1053b81abbe36e3926fe146596f0de473478d97bf82c9c8710877cc72ad7b99a8ad59df6278a5a59051bab
|
data/lib/couchbase.rb
CHANGED
data/lib/couchbase/design_doc.rb
CHANGED
@@ -16,7 +16,11 @@
|
|
16
16
|
#
|
17
17
|
|
18
18
|
module Couchbase
|
19
|
-
class DesignDoc
|
19
|
+
class DesignDoc < ViewRow
|
20
|
+
|
21
|
+
# It isn't allowed to change design document ID after
|
22
|
+
# initialization
|
23
|
+
undef id=
|
20
24
|
|
21
25
|
def initialize(bucket, doc)
|
22
26
|
@all_views = {}
|
@@ -24,6 +28,7 @@ module Couchbase
|
|
24
28
|
@name = doc.name
|
25
29
|
@views = doc.views
|
26
30
|
@spatial = doc.spatial_views
|
31
|
+
@doc = {}
|
27
32
|
@views.each { |view| @all_views[view.name] = "#{@name}/_view/#{view.name}" }
|
28
33
|
@spatial.each { |view| @all_views[view.name] = "#{@name}/_spatial/#{view.name}" }
|
29
34
|
end
|
@@ -63,16 +63,16 @@ module Couchbase::Operations
|
|
63
63
|
else
|
64
64
|
raise ArgumentError, "Document should be Hash, String or IO instance"
|
65
65
|
end
|
66
|
-
|
66
|
+
|
67
67
|
id = attrs.delete('_id').to_s.split('/')[1]
|
68
68
|
|
69
69
|
design_doc = DesignDocument.new(id)
|
70
70
|
|
71
|
-
attrs['views'].each_pair do |view, functions|
|
71
|
+
attrs['views'].each_pair do |view, functions|
|
72
72
|
view_design = if functions['reduce']
|
73
|
-
ViewDesign.new(view, functions['map'], functions['reduce'])
|
73
|
+
ViewDesign.new(view.to_s.to_java_string, functions['map'].to_java_string, functions['reduce'].to_java_string)
|
74
74
|
else
|
75
|
-
ViewDesign.new(view, functions['map'])
|
75
|
+
ViewDesign.new(view.to_s.to_java_string, functions['map'].to_java_string)
|
76
76
|
end
|
77
77
|
design_doc.getViews.add(view_design)
|
78
78
|
end
|
data/lib/couchbase/query.rb
CHANGED
@@ -69,21 +69,21 @@ module Couchbase
|
|
69
69
|
end
|
70
70
|
|
71
71
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
72
|
+
# @option params [true, false] :quiet (true) Do not raise error if
|
73
|
+
# associated document not found in the memory. If the parameter +true+
|
74
|
+
# will use +nil+ value instead.
|
75
|
+
# @option params [String, Symbol] :on_error (:continue) Sets the
|
76
|
+
# response in the event of an error. Supported values:
|
77
|
+
# :continue:: Continue to generate view information in the event of an
|
78
|
+
# error, including the error information in the view
|
79
|
+
# response stream.
|
80
|
+
# :stop:: Stop immediately when an error condition occurs. No
|
81
|
+
# further view information will be returned.
|
82
|
+
# @option params [Fixnum] :connection_timeout (75000) Timeout before the
|
83
|
+
# view request is dropped (milliseconds)
|
84
84
|
|
85
85
|
|
86
|
-
|
86
|
+
# @option params [Hash] :body
|
87
87
|
query
|
88
88
|
end
|
89
89
|
|
data/lib/couchbase/version.rb
CHANGED
data/lib/couchbase/view.rb
CHANGED
@@ -88,8 +88,8 @@ module Couchbase
|
|
88
88
|
@bucket = bucket
|
89
89
|
@endpoint = endpoint
|
90
90
|
@design_doc, @name = parse_endpoint(endpoint)
|
91
|
-
@params = { :connection_timeout => 75_000 }.merge(params)
|
92
91
|
@wrapper_class = params.delete(:wrapper_class) || ViewRow
|
92
|
+
@params = { :connection_timeout => 75_000 }.merge(params)
|
93
93
|
unless @wrapper_class.respond_to?(:wrap)
|
94
94
|
raise ArgumentError, "wrapper class should reposond to :wrap, check the options"
|
95
95
|
end
|
@@ -297,13 +297,13 @@ module Couchbase
|
|
297
297
|
if block_given?
|
298
298
|
block = Proc.new
|
299
299
|
request.each do |data|
|
300
|
-
doc = @wrapper_class.wrap(@bucket, data)
|
300
|
+
doc = @wrapper_class.wrap(@bucket, data.getDocument)
|
301
301
|
block.call(doc)
|
302
302
|
end
|
303
303
|
nil
|
304
304
|
else
|
305
305
|
docs = request.to_a.map { |data|
|
306
|
-
@wrapper_class.wrap(@bucket, data)
|
306
|
+
@wrapper_class.wrap(@bucket, data.getDocument)
|
307
307
|
}
|
308
308
|
docs = ArrayWithTotalRows.new(docs)
|
309
309
|
docs.total_rows = request.size
|
data/test/test_store.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-jruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Evans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -146,8 +146,6 @@ files:
|
|
146
146
|
- lib/couchbase/constants.rb
|
147
147
|
- lib/couchbase/design_doc.rb
|
148
148
|
- lib/couchbase/error.rb
|
149
|
-
- lib/couchbase/jruby/couchbase_client.rb
|
150
|
-
- lib/couchbase/jruby/future.rb
|
151
149
|
- lib/couchbase/operations.rb
|
152
150
|
- lib/couchbase/operations/arithmetic.rb
|
153
151
|
- lib/couchbase/operations/delete.rb
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Couchbase
|
2
|
-
module Jruby
|
3
|
-
class CouchbaseClient < Java::ComCouchbaseClient::CouchbaseClient
|
4
|
-
|
5
|
-
# Futures
|
6
|
-
%w(add set append asyncCAS asyncDecr asyncGet asyncGetAndTouch asyncGetBulk
|
7
|
-
asyncGets asyncIncr delete flush prepend replace set touch).each do |op|
|
8
|
-
define_method(op) do |*|
|
9
|
-
super
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def get(*)
|
14
|
-
super
|
15
|
-
end
|
16
|
-
|
17
|
-
VALUE_OPS = %w(
|
18
|
-
|
19
|
-
).freeze
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|