rethinkdb 1.4.0.1 → 1.4.0.2
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.
- data/lib/func.rb +7 -2
- data/lib/ql2.pb.rb +22 -18
- data/lib/rethinkdb.rb +3 -3
- metadata +7 -7
data/lib/func.rb
CHANGED
@@ -100,8 +100,13 @@ module RethinkDB
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def reduce(*a, &b)
|
103
|
-
|
104
|
-
|
103
|
+
args = a.dup
|
104
|
+
base_offset_front = (@body ? 0 : 1)
|
105
|
+
base_offset_back = args.size - (b ? 1 : 2)
|
106
|
+
if base_offset_front == base_offset_back
|
107
|
+
args << {:base => args.delete_at(base_offset_front)}
|
108
|
+
end
|
109
|
+
super(*args, &b)
|
105
110
|
end
|
106
111
|
|
107
112
|
def grouped_map_reduce(*a, &b)
|
data/lib/ql2.pb.rb
CHANGED
@@ -7,8 +7,11 @@
|
|
7
7
|
# // Process: First send the magic number for the version of the protobuf you're
|
8
8
|
# // targetting (in the [Version] enum). This should **NOT** be sent as a
|
9
9
|
# // protobuf; just send the little-endian 32-bit integer over the wire raw.
|
10
|
-
# // Next,
|
11
|
-
# //
|
10
|
+
# // Next, construct a [Query] protobuf and serialize it to a binary blob. Send
|
11
|
+
# // the blob's size to the server encoded as a little-endian 32-bit integer,
|
12
|
+
# // followed by the blob itself. You will recieve a [Response] protobuf back
|
13
|
+
# // preceded by its own size, once again encoded as a little-endian 32-bit
|
14
|
+
# // integer. You can see an example exchange below in **EXAMPLE**.
|
12
15
|
#
|
13
16
|
# // A query consists of a [Term] to evaluate and a unique-per-connection
|
14
17
|
# // [token].
|
@@ -26,8 +29,8 @@
|
|
26
29
|
# // non-conforming protobuf libraries
|
27
30
|
# enum Version {
|
28
31
|
# V0_1 = 0x3f61ba36;
|
29
|
-
# }
|
30
|
-
# }
|
32
|
+
# }
|
33
|
+
# }
|
31
34
|
#
|
32
35
|
# // You send one of:
|
33
36
|
# // * A [START] query with a [Term] to evaluate and a unique-per-connection token.
|
@@ -40,7 +43,7 @@
|
|
40
43
|
# CONTINUE = 2; // Continue a query that returned [SUCCESS_PARTIAL]
|
41
44
|
# // (see [Response]).
|
42
45
|
# STOP = 3; // Stop a query partway through executing.
|
43
|
-
# }
|
46
|
+
# }
|
44
47
|
# optional QueryType type = 1;
|
45
48
|
# // A [Term] is how we represent the operations we want a query to perform.
|
46
49
|
# optional Term query = 2; // only present when [type] = [START]
|
@@ -50,20 +53,20 @@
|
|
50
53
|
# message AssocPair {
|
51
54
|
# optional string key = 1;
|
52
55
|
# optional Term val = 2;
|
53
|
-
# }
|
56
|
+
# }
|
54
57
|
# repeated AssocPair global_optargs = 6;
|
55
|
-
# }
|
58
|
+
# }
|
56
59
|
#
|
57
60
|
# // A backtrace frame (see `backtrace` in Response below)
|
58
61
|
# message Frame {
|
59
62
|
# enum FrameType {
|
60
63
|
# POS = 1; // Error occured in a positional argument.
|
61
64
|
# OPT = 2; // Error occured in an optional argument.
|
62
|
-
# }
|
65
|
+
# }
|
63
66
|
# optional FrameType type = 1;
|
64
67
|
# optional int64 pos = 2; // The index of the positional argument.
|
65
68
|
# optional string opt = 3; // The name of the optional argument.
|
66
|
-
# }
|
69
|
+
# }
|
67
70
|
# message Backtrace {
|
68
71
|
# repeated Frame frames = 1;
|
69
72
|
# }
|
@@ -91,7 +94,7 @@
|
|
91
94
|
# // if you add together two values from a table, but
|
92
95
|
# // they turn out at runtime to be booleans rather
|
93
96
|
# // than numbers.
|
94
|
-
# }
|
97
|
+
# }
|
95
98
|
# optional ResponseType type = 1;
|
96
99
|
# optional int64 token = 2; // Indicates what [Query] this response corresponds to.
|
97
100
|
#
|
@@ -110,7 +113,7 @@
|
|
110
113
|
# // [Term] message below.)
|
111
114
|
#
|
112
115
|
# optional Backtrace backtrace = 4; // Contains n [Frame]s when you get back an error.
|
113
|
-
# }
|
116
|
+
# }
|
114
117
|
#
|
115
118
|
# // A [Datum] is a chunk of data that can be serialized to disk or returned to
|
116
119
|
# // the user in a Response. Currently we only support JSON types, but we may
|
@@ -123,7 +126,7 @@
|
|
123
126
|
# R_STR = 4;
|
124
127
|
# R_ARRAY = 5;
|
125
128
|
# R_OBJECT = 6;
|
126
|
-
# }
|
129
|
+
# }
|
127
130
|
# optional DatumType type = 1;
|
128
131
|
# optional bool r_bool = 2;
|
129
132
|
# optional double r_num = 3;
|
@@ -133,11 +136,11 @@
|
|
133
136
|
# message AssocPair {
|
134
137
|
# optional string key = 1;
|
135
138
|
# optional Datum val = 2;
|
136
|
-
# }
|
139
|
+
# }
|
137
140
|
# repeated AssocPair r_object = 6;
|
138
141
|
#
|
139
142
|
# extensions 10000 to 20000;
|
140
|
-
# }
|
143
|
+
# }
|
141
144
|
#
|
142
145
|
# // A [Term] is either a piece of data (see **Datum** above), or an operator and
|
143
146
|
# // its operands. If you have a [Datum], it's stored in the member [datum]. If
|
@@ -366,7 +369,8 @@
|
|
366
369
|
# // type = VAR;
|
367
370
|
# // args = [Term {
|
368
371
|
# // type = DATUM;
|
369
|
-
# // datum = Datum { type = R_NUM;
|
372
|
+
# // datum = Datum { type = R_NUM;
|
373
|
+
# // r_num = 1};
|
370
374
|
# // }];
|
371
375
|
# // },
|
372
376
|
# // Term {
|
@@ -379,7 +383,7 @@
|
|
379
383
|
#
|
380
384
|
# ASC = 73;
|
381
385
|
# DESC = 74;
|
382
|
-
# }
|
386
|
+
# }
|
383
387
|
# optional TermType type = 1;
|
384
388
|
#
|
385
389
|
# // This is only used when type is DATUM.
|
@@ -389,13 +393,13 @@
|
|
389
393
|
# message AssocPair {
|
390
394
|
# optional string key = 1;
|
391
395
|
# optional Term val = 2;
|
392
|
-
# }
|
396
|
+
# }
|
393
397
|
# repeated AssocPair optargs = 4; // Holds the optional arguments of the query.
|
394
398
|
# // (Note that the order of the optional arguments doesn't matter; think of a
|
395
399
|
# // Hash.)
|
396
400
|
#
|
397
401
|
# extensions 10000 to 20000;
|
398
|
-
# }
|
402
|
+
# }
|
399
403
|
#
|
400
404
|
# ////////////////////////////////////////////////////////////////////////////////
|
401
405
|
# // EXAMPLE //
|
data/lib/rethinkdb.rb
CHANGED
@@ -3,9 +3,9 @@ require 'rubygems'
|
|
3
3
|
require 'ql2.pb.rb'
|
4
4
|
|
5
5
|
if 2**63 != 9223372036854775808
|
6
|
-
puts "WARNING: Ruby believes 2**63 = #{2**63} rather than 9223372036854775808!"
|
7
|
-
puts "Consider upgrading your verison of Ruby."
|
8
|
-
puts "Hot-patching ruby_protobuf to compensate..."
|
6
|
+
$stderr.puts "WARNING: Ruby believes 2**63 = #{2**63} rather than 9223372036854775808!"
|
7
|
+
$stderr.puts "Consider upgrading your verison of Ruby."
|
8
|
+
$stderr.puts "Hot-patching ruby_protobuf to compensate..."
|
9
9
|
rethinkdb_verbose, $VERBOSE = $VERBOSE, nil
|
10
10
|
module Protobuf
|
11
11
|
module Field
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rethinkdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 123
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 1.4.0.
|
10
|
+
- 2
|
11
|
+
version: 1.4.0.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- RethinkDB Inc.
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-03-
|
19
|
+
date: 2013-03-30 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: json
|
@@ -55,12 +55,12 @@ extensions: []
|
|
55
55
|
extra_rdoc_files: []
|
56
56
|
|
57
57
|
files:
|
58
|
-
- lib/func.rb
|
59
|
-
- lib/shim.rb
|
60
58
|
- lib/exc.rb
|
61
59
|
- lib/ql2.pb.rb
|
62
|
-
- lib/rpp.rb
|
63
60
|
- lib/net.rb
|
61
|
+
- lib/rpp.rb
|
62
|
+
- lib/shim.rb
|
63
|
+
- lib/func.rb
|
64
64
|
- lib/rethinkdb.rb
|
65
65
|
homepage: http://rethinkdb.com
|
66
66
|
licenses:
|