couchbase-jruby-client 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b70e454af837900912ab334c577374656157b1df
4
- data.tar.gz: cd773d813f362ffd5eb695458800fab40ff2d3f0
3
+ metadata.gz: e7083d15093935a06d4e97e63ba51002d380017c
4
+ data.tar.gz: 276b3d3e2a9a5234accd1137408ad9e6f04a6941
5
5
  SHA512:
6
- metadata.gz: cee4caac6a388131d089bac920d651240710b59caeac1dfa8595e301cad01ff0a89f49953b6657ce641831e1f36f25acf7d8678bb0f53d88311e2881b8b5b9b3
7
- data.tar.gz: 8c8127b194702f2a58237f2f71f6064e2782cb89c07365adb5217804c3df2c7eec9ceb32bfdbed9ca2d1c625856740376b5914da2bdcb53d1dbc06c49bf0ef4a
6
+ metadata.gz: 8ee1b9dc433b9765a2ab46c09a2fc18cfc55319696d5f7253783ecbd5371c02090e2501951af4d6b5d82a4ec9ea6a7512b6e1d4f56b358d7958e15d8d3c82e7e
7
+ data.tar.gz: c10067130e72f705671fccd0b032ae9707ce26d24e1053b81abbe36e3926fe146596f0de473478d97bf82c9c8710877cc72ad7b99a8ad59df6278a5a59051bab
@@ -48,7 +48,7 @@ require 'couchbase/query'
48
48
 
49
49
  include Java
50
50
 
51
- import Java::com.couchbase.client.CouchbaseClient;
51
+ java_import Java::com.couchbase.client.CouchbaseClient
52
52
 
53
53
  at_exit do
54
54
  Couchbase.disconnect
@@ -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
@@ -69,21 +69,21 @@ module Couchbase
69
69
  end
70
70
 
71
71
 
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)
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
- # @option params [Hash] :body
86
+ # @option params [Hash] :body
87
87
  query
88
88
  end
89
89
 
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module Couchbase
19
- VERSION = '0.1.3'
19
+ VERSION = '0.1.4'
20
20
  end
@@ -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
@@ -120,7 +120,6 @@ class TestStore < MiniTest::Test
120
120
  end
121
121
 
122
122
  def test_append
123
- skip 'Plain encoding isnt working correctly'
124
123
  cb.default_format = :plain
125
124
 
126
125
  cas1 = cb.set(uniq_id, "foo")
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.3
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-14 00:00:00.000000000 Z
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
@@ -1,8 +0,0 @@
1
- module Couchbase
2
- module Jruby
3
- module Future
4
-
5
-
6
- end
7
- end
8
- end