rethinkdb 2.1.0.2 → 2.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbb7d223e47d54934c1ac7cacc2428c5fbcc703a
4
- data.tar.gz: 59d38d87a0ad38746109a006ca1116e473ee1bf3
3
+ metadata.gz: 60798aad43b5c77c2292e67e6e4fe8ebe9fbf867
4
+ data.tar.gz: fafdffd9312c75094c91e0406cba41d07d0d1236
5
5
  SHA512:
6
- metadata.gz: 614c86b32a5735c20405a5f3003ba5725f01140442da10c56db22c4cb4cfa4a9bf8e8c73d17decc4398776aa8a3c08a66d30b63b1a82da324d6b5065bc362630
7
- data.tar.gz: cbc0b2f65cd489e52b85a573eaf5b8d4bc5fe86b5e203cb8ef1d9f407be07cea73f8416899bdb453cae17ca39cb434bdadabe206c5eccc228f1bd75dd18b59cb
6
+ metadata.gz: a5ad8f76496580b2846cf705a2892dfc0b66478640993c987eb44837e06de2cda5c8aad237c0312b6619b76333cf504def55affa08d133bb6dceefadff405daf
7
+ data.tar.gz: 342b60a7d467a1d698c104c2c73594311cd46cc553820dd85efc81f38f93ddd504ad9d20d58a255d431737c5a3020edf5275c16bfd1379face343d8d30a33a81
data/lib/exc.rb CHANGED
@@ -14,4 +14,6 @@ module RethinkDB
14
14
  ReqlDriverError = RqlDriverError = Class.new(ReqlError)
15
15
  ReqlAuthError = RqlAuthError = Class.new(ReqlDriverError)
16
16
  ReqlCompileError = RqlCompileError = Class.new(ReqlError)
17
+ ReqlServerCompileError = Class.new(ReqlCompileError)
18
+ ReqlDriverCompileError = Class.new(ReqlCompileError)
17
19
  end
data/lib/func.rb CHANGED
@@ -88,7 +88,7 @@ module RethinkDB
88
88
  "This is almost always a precedence error.\n" +
89
89
  "Note that `a < b | b < c` <==> `a < (b | b) < c`.\n" +
90
90
  "If you really want this behavior, use `.or` or `.and` instead."
91
- raise ReqlDriverError, err
91
+ raise ReqlDriverCompileError, err
92
92
  end
93
93
  }
94
94
  end
@@ -151,7 +151,7 @@ module RethinkDB
151
151
  def do(*args, &b)
152
152
  a = ((@body != RQL) ? [self] : []) + args.dup
153
153
  if a == [] && !b
154
- raise ReqlDriverError, "Expected 1 or more arguments but found 0."
154
+ raise ReqlDriverCompileError, "Expected 1 or more arguments but found 0."
155
155
  end
156
156
  funcall_args = (b ? [new_func(&b)] : [a.pop]) + a
157
157
  # PP.pp funcall_args
data/lib/net.rb CHANGED
@@ -755,6 +755,16 @@ module RethinkDB
755
755
  nil
756
756
  end
757
757
 
758
+ def server
759
+ raise ReqlRuntimeError, "Connection is closed." if !is_open()
760
+ q = [Query::QueryType::SERVER_INFO]
761
+ res = run_internal(q, {noreply: false}, new_token)
762
+ if res['t'] != Response::ResponseType::SERVER_INFO
763
+ raise ReqlRuntimeError, "Unexpected response to server_info: " + PP.pp(res, "")
764
+ end
765
+ res['r'][0]
766
+ end
767
+
758
768
  def self.last
759
769
  return @@last if @@last
760
770
  raise ReqlRuntimeError, "No last connection. Use RethinkDB::Connection.new."
data/lib/ql2.pb.rb CHANGED
@@ -22,6 +22,7 @@ module RethinkDB
22
22
  CONTINUE = 2
23
23
  STOP = 3
24
24
  NOREPLY_WAIT = 4
25
+ SERVER_INFO = 5
25
26
  end
26
27
 
27
28
  module AssocPair
@@ -44,6 +45,7 @@ module RethinkDB
44
45
  SUCCESS_SEQUENCE = 2
45
46
  SUCCESS_PARTIAL = 3
46
47
  WAIT_COMPLETE = 4
48
+ SERVER_INFO = 5
47
49
  CLIENT_ERROR = 16
48
50
  COMPILE_ERROR = 17
49
51
  RUNTIME_ERROR = 18
@@ -127,6 +129,7 @@ module RethinkDB
127
129
  CONTAINS = 93
128
130
  GET_FIELD = 31
129
131
  KEYS = 94
132
+ VALUES = 186
130
133
  OBJECT = 143
131
134
  HAS_FIELDS = 32
132
135
  WITH_FIELDS = 96
data/lib/shim.rb CHANGED
@@ -74,7 +74,7 @@ module RethinkDB
74
74
  when re::USER then raise ReqlUserError, r['r'][0]
75
75
  else raise ReqlRuntimeError, r['r'][0]
76
76
  end
77
- when rt::COMPILE_ERROR then raise ReqlCompileError, r['r'][0]
77
+ when rt::COMPILE_ERROR then raise ReqlServerCompileError, r['r'][0]
78
78
  when rt::CLIENT_ERROR then raise ReqlDriverError, r['r'][0]
79
79
  else raise ReqlRuntimeError, "Unexpected response: #{r.inspect}"
80
80
  end
@@ -102,21 +102,21 @@ module RethinkDB
102
102
  when RQL then x.to_pb
103
103
  else { '$reql_type$' => 'BINARY', 'data' => Base64.strict_encode64(x) }
104
104
  end
105
- }, []])
105
+ }])
106
106
  end
107
107
 
108
108
  def self.safe_to_s(x)
109
109
  case x
110
110
  when String then x
111
111
  when Symbol then x.to_s
112
- else raise ReqlDriverError, 'Object keys must be strings or symbols. '+
112
+ else raise ReqlDriverCompileError, 'Object keys must be strings or symbols. '+
113
113
  "(Got object `#{x.inspect}` of class `#{x.class}`.)"
114
114
  end
115
115
  end
116
116
 
117
117
  def self.fast_expr(x, max_depth)
118
118
  if max_depth == 0
119
- raise ReqlDriverError, "Maximum expression depth exceeded " +
119
+ raise ReqlDriverCompileError, "Maximum expression depth exceeded " +
120
120
  "(you can override this with `r.expr(X, MAX_DEPTH)`)."
121
121
  end
122
122
  case x
@@ -143,15 +143,15 @@ module RethinkDB
143
143
  RQL.new({ '$reql_type$' => 'TIME',
144
144
  'epoch_time' => epoch_time,
145
145
  'timezone' => tz })
146
- else raise ReqlDriverError, "r.expr can't handle #{x.inspect} of class #{x.class}."
146
+ else raise ReqlDriverCompileError, "r.expr can't handle #{x.inspect} of class #{x.class}."
147
147
  end
148
148
  end
149
149
 
150
150
  def expr(x, max_depth=20)
151
- unbound_if(@body != RQL)
152
- if !max_depth.is_a?(Numeric)
153
- raise ReqlDriverError, "Second argument to `r.expr` must be a number."
151
+ if not max_depth.is_a? Numeric
152
+ raise ReqlDriverCompileError, "Second argument to `r.expr` must be a number."
154
153
  end
154
+ unbound_if(@body != RQL)
155
155
  RQL.fast_expr(x, max_depth)
156
156
  end
157
157
  def coerce(other)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rethinkdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.2
4
+ version: 2.2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RethinkDB Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-07 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,13 +30,13 @@ executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
+ - lib/ql2.pb.rb
33
34
  - lib/exc.rb
34
35
  - lib/func.rb
35
36
  - lib/net.rb
36
- - lib/rethinkdb.rb
37
37
  - lib/rpp.rb
38
+ - lib/rethinkdb.rb
38
39
  - lib/shim.rb
39
- - lib/ql2.pb.rb
40
40
  homepage: http://rethinkdb.com
41
41
  licenses:
42
42
  - Apache-2