thrift 0.9.1 → 0.9.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{README → README.md} +0 -0
- data/ext/compact_protocol.c +4 -2
- data/ext/constants.h +3 -0
- data/ext/extconf.rb +3 -1
- data/ext/memory_buffer.c +1 -1
- data/ext/strlcpy.h +7 -3
- data/ext/struct.c +22 -3
- data/ext/thrift_native.c +6 -0
- data/lib/thrift.rb +0 -1
- data/lib/thrift/client.rb +13 -4
- data/lib/thrift/protocol/base_protocol.rb +2 -0
- data/lib/thrift/protocol/compact_protocol.rb +2 -1
- data/lib/thrift/protocol/json_protocol.rb +3 -3
- data/spec/Referenced.thrift +44 -0
- data/spec/ThriftNamespacedSpec.thrift +53 -0
- data/spec/namespaced_spec.rb +62 -0
- data/spec/thin_http_server_spec.rb +1 -0
- metadata +31 -13
- checksums.yaml +0 -15
- data/CHANGELOG +0 -1
data/{README → README.md}
RENAMED
File without changes
|
data/ext/compact_protocol.c
CHANGED
@@ -40,6 +40,7 @@ static ID rbuf_ivar_id;
|
|
40
40
|
static int VERSION;
|
41
41
|
static int VERSION_MASK;
|
42
42
|
static int TYPE_MASK;
|
43
|
+
static int TYPE_BITS;
|
43
44
|
static int TYPE_SHIFT_AMOUNT;
|
44
45
|
static int PROTOCOL_ID;
|
45
46
|
|
@@ -315,7 +316,7 @@ VALUE rb_thrift_compact_proto_write_binary(VALUE self, VALUE buf) {
|
|
315
316
|
buf = force_binary_encoding(buf);
|
316
317
|
VALUE transport = GET_TRANSPORT(self);
|
317
318
|
write_varint32(transport, RSTRING_LEN(buf));
|
318
|
-
WRITE(transport,
|
319
|
+
WRITE(transport, StringValuePtr(buf), RSTRING_LEN(buf));
|
319
320
|
return Qnil;
|
320
321
|
}
|
321
322
|
|
@@ -450,7 +451,7 @@ VALUE rb_thrift_compact_proto_read_message_begin(VALUE self) {
|
|
450
451
|
rb_exc_raise(get_protocol_exception(INT2FIX(-1), rb_str_new2(buf)));
|
451
452
|
}
|
452
453
|
|
453
|
-
int8_t type = (version_and_type >> TYPE_SHIFT_AMOUNT) &
|
454
|
+
int8_t type = (version_and_type >> TYPE_SHIFT_AMOUNT) & TYPE_BITS;
|
454
455
|
int32_t seqid = read_varint64(self);
|
455
456
|
VALUE messageName = rb_thrift_compact_proto_read_string(self);
|
456
457
|
return rb_ary_new3(3, messageName, INT2FIX(type), INT2NUM(seqid));
|
@@ -570,6 +571,7 @@ static void Init_constants() {
|
|
570
571
|
VERSION = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION")));
|
571
572
|
VERSION_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION_MASK")));
|
572
573
|
TYPE_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_MASK")));
|
574
|
+
TYPE_BITS = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_BITS")));
|
573
575
|
TYPE_SHIFT_AMOUNT = FIX2INT(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_SHIFT_AMOUNT")));
|
574
576
|
PROTOCOL_ID = FIX2INT(rb_const_get(thrift_compact_protocol_class, rb_intern("PROTOCOL_ID")));
|
575
577
|
|
data/ext/constants.h
CHANGED
@@ -42,6 +42,7 @@ extern ID write_i32_method_id;
|
|
42
42
|
extern ID write_i64_method_id;
|
43
43
|
extern ID write_double_method_id;
|
44
44
|
extern ID write_string_method_id;
|
45
|
+
extern ID write_binary_method_id;
|
45
46
|
extern ID write_map_begin_method_id;
|
46
47
|
extern ID write_map_end_method_id;
|
47
48
|
extern ID write_list_begin_method_id;
|
@@ -54,6 +55,7 @@ extern ID read_i16_method_id;
|
|
54
55
|
extern ID read_i32_method_id;
|
55
56
|
extern ID read_i64_method_id;
|
56
57
|
extern ID read_string_method_id;
|
58
|
+
extern ID read_binary_method_id;
|
57
59
|
extern ID read_double_method_id;
|
58
60
|
extern ID read_map_begin_method_id;
|
59
61
|
extern ID read_map_end_method_id;
|
@@ -87,6 +89,7 @@ extern VALUE key_sym;
|
|
87
89
|
extern VALUE value_sym;
|
88
90
|
extern VALUE element_sym;
|
89
91
|
extern VALUE class_sym;
|
92
|
+
extern VALUE binary_sym;
|
90
93
|
|
91
94
|
extern VALUE rb_cSet;
|
92
95
|
extern VALUE thrift_module;
|
data/ext/extconf.rb
CHANGED
@@ -21,8 +21,10 @@ if defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/
|
|
21
21
|
File.open('Makefile', 'w'){|f| f.puts "all:\n\ninstall:\n" }
|
22
22
|
else
|
23
23
|
require 'mkmf'
|
24
|
+
require 'rbconfig'
|
25
|
+
|
26
|
+
$ARCH_FLAGS = RbConfig::CONFIG['CFLAGS'].scan( /(-arch )(\S+)/ ).map{|x,y| x + y + ' ' }.join('')
|
24
27
|
|
25
|
-
$ARCH_FLAGS = Config::CONFIG['CFLAGS'].scan( /(-arch )(\S+)/ ).map{|x,y| x + y + ' ' }.join('')
|
26
28
|
|
27
29
|
$CFLAGS = "-fsigned-char -g -O2 -Wall -Werror " + $ARCH_FLAGS
|
28
30
|
|
data/ext/memory_buffer.c
CHANGED
@@ -39,7 +39,7 @@ VALUE rb_thrift_memory_buffer_read_into_buffer(VALUE self, VALUE buffer_value, V
|
|
39
39
|
VALUE rb_thrift_memory_buffer_write(VALUE self, VALUE str) {
|
40
40
|
VALUE buf = GET_BUF(self);
|
41
41
|
str = force_binary_encoding(str);
|
42
|
-
rb_str_buf_cat(buf,
|
42
|
+
rb_str_buf_cat(buf, StringValuePtr(str), RSTRING_LEN(str));
|
43
43
|
return Qnil;
|
44
44
|
}
|
45
45
|
|
data/ext/strlcpy.h
CHANGED
@@ -17,14 +17,18 @@
|
|
17
17
|
* under the License.
|
18
18
|
*/
|
19
19
|
|
20
|
-
|
21
20
|
#include <sys/types.h>
|
22
21
|
#include <string.h>
|
23
22
|
|
23
|
+
#ifndef __has_builtin
|
24
|
+
#define __has_builtin(x) 0
|
25
|
+
#endif
|
26
|
+
|
24
27
|
#ifndef HAVE_STRLCPY
|
25
|
-
size_t
|
26
|
-
strlcpy (char *dst, const char *src, size_t dst_sz);
|
28
|
+
size_t strlcpy (char *dst, const char *src, size_t dst_sz);
|
27
29
|
#else
|
30
|
+
#if !__has_builtin(strlcpy)
|
28
31
|
extern size_t strlcpy(char *, const char *, size_t);
|
29
32
|
#endif
|
33
|
+
#endif
|
30
34
|
|
data/ext/struct.c
CHANGED
@@ -75,6 +75,11 @@ VALUE default_write_string(VALUE protocol, VALUE value) {
|
|
75
75
|
return Qnil;
|
76
76
|
}
|
77
77
|
|
78
|
+
VALUE default_write_binary(VALUE protocol, VALUE value) {
|
79
|
+
rb_funcall(protocol, write_binary_method_id, 1, value);
|
80
|
+
return Qnil;
|
81
|
+
}
|
82
|
+
|
78
83
|
VALUE default_write_list_begin(VALUE protocol, VALUE etype, VALUE length) {
|
79
84
|
rb_funcall(protocol, write_list_begin_method_id, 2, etype, length);
|
80
85
|
return Qnil;
|
@@ -190,6 +195,10 @@ VALUE default_read_string(VALUE protocol) {
|
|
190
195
|
return rb_funcall(protocol, read_string_method_id, 0);
|
191
196
|
}
|
192
197
|
|
198
|
+
VALUE default_read_binary(VALUE protocol) {
|
199
|
+
return rb_funcall(protocol, read_binary_method_id, 0);
|
200
|
+
}
|
201
|
+
|
193
202
|
VALUE default_read_struct_begin(VALUE protocol) {
|
194
203
|
return rb_funcall(protocol, read_struct_begin_method_id, 0);
|
195
204
|
}
|
@@ -327,7 +336,12 @@ static void write_anything(int ttype, VALUE value, VALUE protocol, VALUE field_i
|
|
327
336
|
} else if (ttype == TTYPE_DOUBLE) {
|
328
337
|
default_write_double(protocol, value);
|
329
338
|
} else if (ttype == TTYPE_STRING) {
|
330
|
-
|
339
|
+
VALUE is_binary = rb_hash_aref(field_info, binary_sym);
|
340
|
+
if (is_binary != Qtrue) {
|
341
|
+
default_write_string(protocol, value);
|
342
|
+
} else {
|
343
|
+
default_write_binary(protocol, value);
|
344
|
+
}
|
331
345
|
} else if (IS_CONTAINER(ttype)) {
|
332
346
|
write_container(ttype, field_info, value, protocol);
|
333
347
|
} else if (ttype == TTYPE_STRUCT) {
|
@@ -430,7 +444,12 @@ static VALUE read_anything(VALUE protocol, int ttype, VALUE field_info) {
|
|
430
444
|
} else if (ttype == TTYPE_I64) {
|
431
445
|
result = default_read_i64(protocol);
|
432
446
|
} else if (ttype == TTYPE_STRING) {
|
433
|
-
|
447
|
+
VALUE is_binary = rb_hash_aref(field_info, binary_sym);
|
448
|
+
if (is_binary != Qtrue) {
|
449
|
+
result = default_read_string(protocol);
|
450
|
+
} else {
|
451
|
+
result = default_read_binary(protocol);
|
452
|
+
}
|
434
453
|
} else if (ttype == TTYPE_DOUBLE) {
|
435
454
|
result = default_read_double(protocol);
|
436
455
|
} else if (ttype == TTYPE_STRUCT) {
|
@@ -607,7 +626,7 @@ static VALUE rb_thrift_union_read(VALUE self, VALUE protocol) {
|
|
607
626
|
if (field_type == specified_type) {
|
608
627
|
// read the value
|
609
628
|
VALUE name = rb_hash_aref(field_info, name_sym);
|
610
|
-
rb_iv_set(self, "@setfield",
|
629
|
+
rb_iv_set(self, "@setfield", rb_str_intern(name));
|
611
630
|
rb_iv_set(self, "@value", read_anything(protocol, field_type, field_info));
|
612
631
|
} else {
|
613
632
|
rb_funcall(protocol, skip_method_id, 1, field_type_value);
|
data/ext/thrift_native.c
CHANGED
@@ -57,6 +57,7 @@ ID write_i32_method_id;
|
|
57
57
|
ID write_i64_method_id;
|
58
58
|
ID write_double_method_id;
|
59
59
|
ID write_string_method_id;
|
60
|
+
ID write_binary_method_id;
|
60
61
|
ID write_map_begin_method_id;
|
61
62
|
ID write_map_end_method_id;
|
62
63
|
ID write_list_begin_method_id;
|
@@ -69,6 +70,7 @@ ID read_i16_method_id;
|
|
69
70
|
ID read_i32_method_id;
|
70
71
|
ID read_i64_method_id;
|
71
72
|
ID read_string_method_id;
|
73
|
+
ID read_binary_method_id;
|
72
74
|
ID read_double_method_id;
|
73
75
|
ID read_map_begin_method_id;
|
74
76
|
ID read_map_end_method_id;
|
@@ -104,6 +106,7 @@ VALUE key_sym;
|
|
104
106
|
VALUE value_sym;
|
105
107
|
VALUE element_sym;
|
106
108
|
VALUE class_sym;
|
109
|
+
VALUE binary_sym;
|
107
110
|
VALUE protocol_exception_class;
|
108
111
|
|
109
112
|
void Init_thrift_native() {
|
@@ -140,6 +143,7 @@ void Init_thrift_native() {
|
|
140
143
|
write_i64_method_id = rb_intern("write_i64");
|
141
144
|
write_double_method_id = rb_intern("write_double");
|
142
145
|
write_string_method_id = rb_intern("write_string");
|
146
|
+
write_binary_method_id = rb_intern("write_binary");
|
143
147
|
write_map_begin_method_id = rb_intern("write_map_begin");
|
144
148
|
write_map_end_method_id = rb_intern("write_map_end");
|
145
149
|
write_list_begin_method_id = rb_intern("write_list_begin");
|
@@ -152,6 +156,7 @@ void Init_thrift_native() {
|
|
152
156
|
read_i32_method_id = rb_intern("read_i32");
|
153
157
|
read_i64_method_id = rb_intern("read_i64");
|
154
158
|
read_string_method_id = rb_intern("read_string");
|
159
|
+
read_binary_method_id = rb_intern("read_binary");
|
155
160
|
read_double_method_id = rb_intern("read_double");
|
156
161
|
read_map_begin_method_id = rb_intern("read_map_begin");
|
157
162
|
read_map_end_method_id = rb_intern("read_map_end");
|
@@ -187,6 +192,7 @@ void Init_thrift_native() {
|
|
187
192
|
value_sym = ID2SYM(rb_intern("value"));
|
188
193
|
element_sym = ID2SYM(rb_intern("element"));
|
189
194
|
class_sym = ID2SYM(rb_intern("class"));
|
195
|
+
binary_sym = ID2SYM(rb_intern("binary"));
|
190
196
|
|
191
197
|
Init_struct();
|
192
198
|
Init_binary_protocol_accelerated();
|
data/lib/thrift.rb
CHANGED
data/lib/thrift/client.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
#
|
2
2
|
# Licensed to the Apache Software Foundation (ASF) under one
|
3
3
|
# or more contributor license agreements. See the NOTICE file
|
4
4
|
# distributed with this work for additional information
|
@@ -6,16 +6,16 @@
|
|
6
6
|
# to you under the Apache License, Version 2.0 (the
|
7
7
|
# "License"); you may not use this file except in compliance
|
8
8
|
# with the License. You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing,
|
13
13
|
# software distributed under the License is distributed on an
|
14
14
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
15
|
# KIND, either express or implied. See the License for the
|
16
16
|
# specific language governing permissions and limitations
|
17
17
|
# under the License.
|
18
|
-
#
|
18
|
+
#
|
19
19
|
|
20
20
|
module Thrift
|
21
21
|
module Client
|
@@ -27,6 +27,15 @@ module Thrift
|
|
27
27
|
|
28
28
|
def send_message(name, args_class, args = {})
|
29
29
|
@oprot.write_message_begin(name, MessageTypes::CALL, @seqid)
|
30
|
+
send_message_args(args_class, args)
|
31
|
+
end
|
32
|
+
|
33
|
+
def send_oneway_message(name, args_class, args = {})
|
34
|
+
@oprot.write_message_begin(name, MessageTypes::ONEWAY, @seqid)
|
35
|
+
send_message_args(args_class, args)
|
36
|
+
end
|
37
|
+
|
38
|
+
def send_message_args(args_class, args)
|
30
39
|
data = args_class.new
|
31
40
|
args.each do |k, v|
|
32
41
|
data.send("#{k.to_s}=", v)
|
@@ -24,6 +24,7 @@ module Thrift
|
|
24
24
|
VERSION = 1
|
25
25
|
VERSION_MASK = 0x1f
|
26
26
|
TYPE_MASK = 0xE0
|
27
|
+
TYPE_BITS = 0x07
|
27
28
|
TYPE_SHIFT_AMOUNT = 5
|
28
29
|
|
29
30
|
TSTOP = ["", Types::STOP, 0]
|
@@ -231,7 +232,7 @@ module Thrift
|
|
231
232
|
raise ProtocolException.new("Expected version #{VERSION} but got #{version}");
|
232
233
|
end
|
233
234
|
|
234
|
-
type = (version_and_type >> TYPE_SHIFT_AMOUNT) &
|
235
|
+
type = (version_and_type >> TYPE_SHIFT_AMOUNT) & TYPE_BITS
|
235
236
|
seqid = read_varint32()
|
236
237
|
messageName = read_string()
|
237
238
|
[messageName, type, seqid]
|
@@ -507,13 +507,13 @@ module Thrift
|
|
507
507
|
def read_json_string(skipContext = false)
|
508
508
|
# This string's characters must match up with the elements in escape_char_vals.
|
509
509
|
# I don't have '/' on this list even though it appears on www.json.org --
|
510
|
-
# it is not in the RFC
|
511
|
-
escape_chars = "\"
|
510
|
+
# it is not in the RFC -> it is. See RFC 4627
|
511
|
+
escape_chars = "\"\\/bfnrt"
|
512
512
|
|
513
513
|
# The elements of this array must match up with the sequence of characters in
|
514
514
|
# escape_chars
|
515
515
|
escape_char_vals = [
|
516
|
-
'"', '\\', '\b', '\f', '\n', '\r', '\t',
|
516
|
+
'"', '\\', '/', '\b', '\f', '\n', '\r', '\t',
|
517
517
|
]
|
518
518
|
|
519
519
|
if !skipContext
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
4
|
+
* distributed with this work for additional information
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
7
|
+
* "License"); you may not use this file except in compliance
|
8
|
+
* with the License. You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
#
|
21
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
22
|
+
# or more contributor license agreements. See the NOTICE file
|
23
|
+
# distributed with this work for additional information
|
24
|
+
# regarding copyright ownership. The ASF licenses this file
|
25
|
+
# to you under the Apache License, Version 2.0 (the
|
26
|
+
# "License"); you may not use this file except in compliance
|
27
|
+
# with the License. You may obtain a copy of the License at
|
28
|
+
#
|
29
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
30
|
+
#
|
31
|
+
# Unless required by applicable law or agreed to in writing,
|
32
|
+
# software distributed under the License is distributed on an
|
33
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
34
|
+
# KIND, either express or implied. See the License for the
|
35
|
+
# specific language governing permissions and limitations
|
36
|
+
# under the License.
|
37
|
+
#
|
38
|
+
|
39
|
+
namespace rb OtherNamespace
|
40
|
+
|
41
|
+
enum SomeEnum {
|
42
|
+
ONE
|
43
|
+
TWO
|
44
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/*
|
2
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
* or more contributor license agreements. See the NOTICE file
|
4
|
+
* distributed with this work for additional information
|
5
|
+
* regarding copyright ownership. The ASF licenses this file
|
6
|
+
* to you under the Apache License, Version 2.0 (the
|
7
|
+
* "License"); you may not use this file except in compliance
|
8
|
+
* with the License. You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing,
|
13
|
+
* software distributed under the License is distributed on an
|
14
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
* KIND, either express or implied. See the License for the
|
16
|
+
* specific language governing permissions and limitations
|
17
|
+
* under the License.
|
18
|
+
*/
|
19
|
+
|
20
|
+
#
|
21
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
22
|
+
# or more contributor license agreements. See the NOTICE file
|
23
|
+
# distributed with this work for additional information
|
24
|
+
# regarding copyright ownership. The ASF licenses this file
|
25
|
+
# to you under the Apache License, Version 2.0 (the
|
26
|
+
# "License"); you may not use this file except in compliance
|
27
|
+
# with the License. You may obtain a copy of the License at
|
28
|
+
#
|
29
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
30
|
+
#
|
31
|
+
# Unless required by applicable law or agreed to in writing,
|
32
|
+
# software distributed under the License is distributed on an
|
33
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
34
|
+
# KIND, either express or implied. See the License for the
|
35
|
+
# specific language governing permissions and limitations
|
36
|
+
# under the License.
|
37
|
+
#
|
38
|
+
|
39
|
+
namespace rb NamespacedSpecNamespace
|
40
|
+
|
41
|
+
include "Referenced.thrift"
|
42
|
+
|
43
|
+
struct Hello {
|
44
|
+
1: string greeting = "hello world"
|
45
|
+
}
|
46
|
+
|
47
|
+
service NamespacedNonblockingService {
|
48
|
+
Hello greeting(1:bool english)
|
49
|
+
bool block()
|
50
|
+
oneway void unblock(1:i32 n)
|
51
|
+
oneway void shutdown()
|
52
|
+
void sleep(1:double seconds)
|
53
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'spec_helper'
|
21
|
+
|
22
|
+
describe 'namespaced generation' do
|
23
|
+
before do
|
24
|
+
require 'namespaced_spec_namespace/namespaced_nonblocking_service'
|
25
|
+
end
|
26
|
+
|
27
|
+
it "generated the right files" do
|
28
|
+
prefix = File.expand_path("../gen-rb", __FILE__)
|
29
|
+
["namespaced_spec_namespace/namespaced_nonblocking_service.rb",
|
30
|
+
"namespaced_spec_namespace/thrift_namespaced_spec_constants.rb",
|
31
|
+
"namespaced_spec_namespace/thrift_namespaced_spec_types.rb",
|
32
|
+
"other_namespace/referenced_constants.rb",
|
33
|
+
"other_namespace/referenced_types.rb"
|
34
|
+
].each do |name|
|
35
|
+
File.exist?(File.join(prefix, name)).should be_true
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "did not generate the wrong files" do
|
40
|
+
prefix = File.expand_path("../gen-rb", __FILE__)
|
41
|
+
["namespaced_nonblocking_service.rb",
|
42
|
+
"thrift_namespaced_spec_constants.rb",
|
43
|
+
"thrift_namespaced_spec_types.rb",
|
44
|
+
"referenced_constants.rb",
|
45
|
+
"referenced_types.rb"
|
46
|
+
].each do |name|
|
47
|
+
File.exist?(File.join(prefix, name)).should_not be_true
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
it "has a service class in the right place" do
|
52
|
+
defined?(NamespacedSpecNamespace::NamespacedNonblockingService).should be_true
|
53
|
+
end
|
54
|
+
|
55
|
+
it "has a struct in the right place" do
|
56
|
+
defined?(NamespacedSpecNamespace::Hello).should be_true
|
57
|
+
end
|
58
|
+
|
59
|
+
it "required an included file" do
|
60
|
+
defined?(OtherNamespace::SomeEnum).should be_true
|
61
|
+
end
|
62
|
+
end
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thrift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Thrift Developers
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rspec
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rack
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rack-test
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,6 +62,7 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: thin
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
67
|
- - ~>
|
60
68
|
- !ruby/object:Gem::Version
|
@@ -62,6 +70,7 @@ dependencies:
|
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
75
|
- - ~>
|
67
76
|
- !ruby/object:Gem::Version
|
@@ -69,20 +78,23 @@ dependencies:
|
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: bundler
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- -
|
83
|
+
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
85
|
+
version: '0'
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- -
|
91
|
+
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
93
|
+
version: '0'
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: rake
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -101,8 +114,7 @@ executables: []
|
|
101
114
|
extensions:
|
102
115
|
- ext/extconf.rb
|
103
116
|
extra_rdoc_files:
|
104
|
-
-
|
105
|
-
- README
|
117
|
+
- README.md
|
106
118
|
- ext/binary_protocol_accelerated.c
|
107
119
|
- ext/bytes.c
|
108
120
|
- ext/compact_protocol.c
|
@@ -207,8 +219,10 @@ files:
|
|
207
219
|
- spec/exception_spec.rb
|
208
220
|
- spec/http_client_spec.rb
|
209
221
|
- spec/json_protocol_spec.rb
|
222
|
+
- spec/namespaced_spec.rb
|
210
223
|
- spec/nonblocking_server_spec.rb
|
211
224
|
- spec/processor_spec.rb
|
225
|
+
- spec/Referenced.thrift
|
212
226
|
- spec/serializer_spec.rb
|
213
227
|
- spec/server_socket_spec.rb
|
214
228
|
- spec/server_spec.rb
|
@@ -218,12 +232,12 @@ files:
|
|
218
232
|
- spec/struct_nested_containers_spec.rb
|
219
233
|
- spec/struct_spec.rb
|
220
234
|
- spec/thin_http_server_spec.rb
|
235
|
+
- spec/ThriftNamespacedSpec.thrift
|
221
236
|
- spec/ThriftSpec.thrift
|
222
237
|
- spec/types_spec.rb
|
223
238
|
- spec/union_spec.rb
|
224
239
|
- spec/unix_socket_spec.rb
|
225
|
-
-
|
226
|
-
- README
|
240
|
+
- README.md
|
227
241
|
- ext/binary_protocol_accelerated.c
|
228
242
|
- ext/bytes.c
|
229
243
|
- ext/compact_protocol.c
|
@@ -250,7 +264,6 @@ files:
|
|
250
264
|
homepage: http://thrift.apache.org
|
251
265
|
licenses:
|
252
266
|
- Apache 2.0
|
253
|
-
metadata: {}
|
254
267
|
post_install_message:
|
255
268
|
rdoc_options:
|
256
269
|
- --line-numbers
|
@@ -263,20 +276,22 @@ require_paths:
|
|
263
276
|
- lib
|
264
277
|
- ext
|
265
278
|
required_ruby_version: !ruby/object:Gem::Requirement
|
279
|
+
none: false
|
266
280
|
requirements:
|
267
281
|
- - ! '>='
|
268
282
|
- !ruby/object:Gem::Version
|
269
283
|
version: '0'
|
270
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
285
|
+
none: false
|
271
286
|
requirements:
|
272
287
|
- - ! '>='
|
273
288
|
- !ruby/object:Gem::Version
|
274
289
|
version: '0'
|
275
290
|
requirements: []
|
276
291
|
rubyforge_project: thrift
|
277
|
-
rubygems_version:
|
292
|
+
rubygems_version: 1.8.23
|
278
293
|
signing_key:
|
279
|
-
specification_version:
|
294
|
+
specification_version: 3
|
280
295
|
summary: Ruby bindings for Apache Thrift
|
281
296
|
test_files:
|
282
297
|
- spec/base_protocol_spec.rb
|
@@ -290,8 +305,10 @@ test_files:
|
|
290
305
|
- spec/exception_spec.rb
|
291
306
|
- spec/http_client_spec.rb
|
292
307
|
- spec/json_protocol_spec.rb
|
308
|
+
- spec/namespaced_spec.rb
|
293
309
|
- spec/nonblocking_server_spec.rb
|
294
310
|
- spec/processor_spec.rb
|
311
|
+
- spec/Referenced.thrift
|
295
312
|
- spec/serializer_spec.rb
|
296
313
|
- spec/server_socket_spec.rb
|
297
314
|
- spec/server_spec.rb
|
@@ -301,6 +318,7 @@ test_files:
|
|
301
318
|
- spec/struct_nested_containers_spec.rb
|
302
319
|
- spec/struct_spec.rb
|
303
320
|
- spec/thin_http_server_spec.rb
|
321
|
+
- spec/ThriftNamespacedSpec.thrift
|
304
322
|
- spec/ThriftSpec.thrift
|
305
323
|
- spec/types_spec.rb
|
306
324
|
- spec/union_spec.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
MzRjZDcyMTAwY2Y3MTJkYTU2Mzk1MzdmYWYyOWFiMzAwOWU3NzYwZA==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
N2Y2MDQ4ZjBhYWM1N2IyOGI2ODE5NDYzNzBjZmRmYTI0NDIxODc1MQ==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NWE1NzdmMDg3NjdiZGQzNjdkNzhhYzE1NTVkOGMxN2NlMzRmMmUxZDQ1NWNj
|
10
|
-
ZTUyNGM1YWRjNjM0MDViMWUzMWVjMzY5YzhiNzBhYWJmODk5OGUwODk3NjRh
|
11
|
-
NTgwNzdhZjIyYWJiZTMxZmJlODdlYzlmYjQ2MWI5ZGU2NmVmZDE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTE1ODAyOTM5M2E4OGFlMmYyNDFjYjVkMTcyMjA4MDEzM2I1MmE3ZDg2ZmIy
|
14
|
-
MGVjYjFhM2VlOGZlM2U2YjM0YzdkZTgxYmJjNmExMDIyNTIyNDc4MGY5ZjUx
|
15
|
-
MjhiY2Y3NzM5NGIwZGE5MWMyOTY2ZmU0YWI3YzI4MTYwMzg1Nzc=
|
data/CHANGELOG
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
v0.0.1. Initial release
|