thrift_client 0.9.3 → 0.10.0
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 +7 -0
- data/test/greeter/server.rb +3 -1
- data/test/simple_test.rb +27 -27
- metadata +24 -33
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: aba2a9a2e60501cc3c236a2166015c176e0a086e
|
|
4
|
+
data.tar.gz: 6f1400476d863abe0d79a421c04b8d197639dc4e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c71e345cfd2ad29716ad14ca95abab1e48817c17e320b068c6ea2b8363f612e5f0bebd61956831c4f931da4ea31d19cd779f9649b92264597b2c9c8e63217c3f
|
|
7
|
+
data.tar.gz: 7fb75b6c937640d780d132a6a10c7f15732033d81b08978a8fbbdd395b8081e411d2721e14d7a5c5e2a82a7fbaa0ea6b0cd56381bc8b3c9296379c590047ff8c
|
data/test/greeter/server.rb
CHANGED
data/test/simple_test.rb
CHANGED
|
@@ -21,52 +21,52 @@ class SimpleTest < Test::Unit::TestCase
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def test_byte_encoding
|
|
24
|
-
assert_equal "\xc7", S.pack_value(S::BYTE, 199)
|
|
24
|
+
assert_equal "\xc7".bytes, S.pack_value(S::BYTE, 199).bytes
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def test_i16_encoding
|
|
28
|
-
assert_equal "\x00\x96", S.pack_value(S::I16, 150)
|
|
28
|
+
assert_equal "\x00\x96".bytes, S.pack_value(S::I16, 150).bytes
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def test_i32_encoding
|
|
32
|
-
assert_equal "\x00\x96\xb4\x3f", S.pack_value(S::I32, 9876543)
|
|
32
|
+
assert_equal "\x00\x96\xb4\x3f".bytes, S.pack_value(S::I32, 9876543).bytes
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def test_i64_encoding
|
|
36
|
-
assert_equal "\x00\x00\x00\x1c\xbb\xf3\x09\x04", S.pack_value(S::I64, 123412351236)
|
|
36
|
+
assert_equal "\x00\x00\x00\x1c\xbb\xf3\x09\x04".bytes, S.pack_value(S::I64, 123412351236).bytes
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def test_double_encoding
|
|
40
|
-
assert_equal "\x40\x23\x00\x00\x00\x00\x00\x00", S.pack_value(S::DOUBLE, 9.5)
|
|
40
|
+
assert_equal "\x40\x23\x00\x00\x00\x00\x00\x00".bytes, S.pack_value(S::DOUBLE, 9.5).bytes
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def test_string_encoding
|
|
44
|
-
assert_equal "\x00\x00\x00\x05hello", S.pack_value(S::STRING, "hello")
|
|
44
|
+
assert_equal "\x00\x00\x00\x05hello".bytes, S.pack_value(S::STRING, "hello").bytes
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def test_list_encoding
|
|
48
|
-
assert_equal "\x08\x00\x00\x00\x03\x00\x00\x00\x17\x00\x00\x00\x16\x00\x00\x00\x15",
|
|
49
|
-
S.pack_value(S::ListType.new(S::I32), [ 23, 22, 21 ])
|
|
48
|
+
assert_equal "\x08\x00\x00\x00\x03\x00\x00\x00\x17\x00\x00\x00\x16\x00\x00\x00\x15".bytes,
|
|
49
|
+
S.pack_value(S::ListType.new(S::I32), [ 23, 22, 21 ]).bytes
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def test_map_encoding
|
|
53
|
-
assert_equal "\x0b\x08\x00\x00\x00\x01\x00\x00\x00\x03cat\x00\x00\x00\x05",
|
|
54
|
-
S.pack_value(S::MapType.new(S::STRING, S::I32), "cat" => 5)
|
|
53
|
+
assert_equal "\x0b\x08\x00\x00\x00\x01\x00\x00\x00\x03cat\x00\x00\x00\x05".bytes,
|
|
54
|
+
S.pack_value(S::MapType.new(S::STRING, S::I32), "cat" => 5).bytes
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def test_set_encoding
|
|
58
|
-
assert_equal "\x08\x00\x00\x00\x01\x00\x00\x00\x04",
|
|
59
|
-
S.pack_value(S::SetType.new(S::I32), [ 4 ])
|
|
58
|
+
assert_equal "\x08\x00\x00\x00\x01\x00\x00\x00\x04".bytes,
|
|
59
|
+
S.pack_value(S::SetType.new(S::I32), [ 4 ]).bytes
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def test_struct_encoding
|
|
63
|
-
assert_equal "\x0b\x00\x01\x00\x00\x00\x06Commie\x00",
|
|
64
|
-
S.pack_value(S::StructType.new(Struct::ST_Example), Struct::ST_Example.new("Commie"))
|
|
63
|
+
assert_equal "\x0b\x00\x01\x00\x00\x00\x06Commie\x00".bytes,
|
|
64
|
+
S.pack_value(S::StructType.new(Struct::ST_Example), Struct::ST_Example.new("Commie")).bytes
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def test_request_encoding
|
|
68
|
-
assert_equal "\x80\x01\x00\x01\x00\x00\x00\x09getHeight\x00\x00\x00\x17\x00",
|
|
69
|
-
S.pack_request("getHeight", Struct::ST_Args.new, 23)
|
|
68
|
+
assert_equal "\x80\x01\x00\x01\x00\x00\x00\x09getHeight\x00\x00\x00\x17\x00".bytes,
|
|
69
|
+
S.pack_request("getHeight", Struct::ST_Args.new, 23).bytes
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
## Decoding
|
|
@@ -89,12 +89,12 @@ class SimpleTest < Test::Unit::TestCase
|
|
|
89
89
|
end
|
|
90
90
|
|
|
91
91
|
def test_i64_decoding
|
|
92
|
-
assert_equal 123412351236,
|
|
92
|
+
assert_equal 123412351236,
|
|
93
93
|
S.read_value(StringIO.new("\x00\x00\x00\x1c\xbb\xf3\x09\x04"), S::I64)
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def test_double_decoding
|
|
97
|
-
assert_equal 9.5,
|
|
97
|
+
assert_equal 9.5,
|
|
98
98
|
S.read_value(StringIO.new("\x40\x23\x00\x00\x00\x00\x00\x00"), S::DOUBLE)
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -103,31 +103,31 @@ class SimpleTest < Test::Unit::TestCase
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def test_list_decoding
|
|
106
|
-
assert_equal [ 23, 22, 21 ],
|
|
107
|
-
S.read_value(StringIO.new("\x08\x00\x00\x00\x03\x00\x00\x00\x17\x00\x00\x00\x16\x00\x00\x00\x15"),
|
|
106
|
+
assert_equal [ 23, 22, 21 ],
|
|
107
|
+
S.read_value(StringIO.new("\x08\x00\x00\x00\x03\x00\x00\x00\x17\x00\x00\x00\x16\x00\x00\x00\x15"),
|
|
108
108
|
S::ListType.new(S::I32))
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
def test_map_decoding
|
|
112
|
-
assert_equal({ "cat" => 5 },
|
|
113
|
-
S.read_value(StringIO.new("\x0b\x08\x00\x00\x00\x01\x00\x00\x00\x03cat\x00\x00\x00\x05"),
|
|
112
|
+
assert_equal({ "cat" => 5 },
|
|
113
|
+
S.read_value(StringIO.new("\x0b\x08\x00\x00\x00\x01\x00\x00\x00\x03cat\x00\x00\x00\x05"),
|
|
114
114
|
S::MapType.new(S::STRING, S::I32)))
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def test_set_decoding
|
|
118
|
-
assert_equal [ 4 ],
|
|
119
|
-
S.read_value(StringIO.new("\x08\x00\x00\x00\x01\x00\x00\x00\x04"),
|
|
118
|
+
assert_equal [ 4 ],
|
|
119
|
+
S.read_value(StringIO.new("\x08\x00\x00\x00\x01\x00\x00\x00\x04"),
|
|
120
120
|
S::ListType.new(S::I32))
|
|
121
121
|
end
|
|
122
122
|
|
|
123
123
|
def test_struct_decoding
|
|
124
|
-
assert_equal Struct::ST_Example.new("Commie"),
|
|
125
|
-
S.read_value(StringIO.new("\x0b\x00\x01\x00\x00\x00\x06Commie\x00"),
|
|
124
|
+
assert_equal Struct::ST_Example.new("Commie"),
|
|
125
|
+
S.read_value(StringIO.new("\x0b\x00\x01\x00\x00\x00\x06Commie\x00"),
|
|
126
126
|
S::StructType.new(Struct::ST_Example))
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
def test_response_decoding
|
|
130
|
-
assert_equal [ "getHeight", 255, 1 ],
|
|
130
|
+
assert_equal [ "getHeight", 255, 1 ],
|
|
131
131
|
S.read_response(
|
|
132
132
|
StringIO.new("\x80\x01\x00\x02\x00\x00\x00\x09getHeight\x00\x00\x00\xff\x08\x00\x00\x00\x00\x00\x01\x00"),
|
|
133
133
|
Struct::ST_Retval)
|
metadata
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thrift_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.10.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Evan Weaver
|
|
@@ -11,70 +10,62 @@ authors:
|
|
|
11
10
|
autorequire:
|
|
12
11
|
bindir: bin
|
|
13
12
|
cert_chain: []
|
|
14
|
-
date:
|
|
13
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
|
15
14
|
dependencies:
|
|
16
15
|
- !ruby/object:Gem::Dependency
|
|
17
16
|
name: thrift
|
|
18
17
|
requirement: !ruby/object:Gem::Requirement
|
|
19
|
-
none: false
|
|
20
18
|
requirements:
|
|
21
|
-
- - ~>
|
|
19
|
+
- - "~>"
|
|
22
20
|
- !ruby/object:Gem::Version
|
|
23
|
-
version: 0.
|
|
21
|
+
version: 0.10.0
|
|
24
22
|
type: :runtime
|
|
25
23
|
prerelease: false
|
|
26
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
27
|
-
none: false
|
|
28
25
|
requirements:
|
|
29
|
-
- - ~>
|
|
26
|
+
- - "~>"
|
|
30
27
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: 0.
|
|
28
|
+
version: 0.10.0
|
|
32
29
|
- !ruby/object:Gem::Dependency
|
|
33
|
-
name:
|
|
30
|
+
name: rack
|
|
34
31
|
requirement: !ruby/object:Gem::Requirement
|
|
35
|
-
none: false
|
|
36
32
|
requirements:
|
|
37
|
-
- -
|
|
33
|
+
- - ">="
|
|
38
34
|
- !ruby/object:Gem::Version
|
|
39
35
|
version: '0'
|
|
40
36
|
type: :development
|
|
41
37
|
prerelease: false
|
|
42
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
-
none: false
|
|
44
39
|
requirements:
|
|
45
|
-
- -
|
|
40
|
+
- - ">="
|
|
46
41
|
- !ruby/object:Gem::Version
|
|
47
42
|
version: '0'
|
|
48
43
|
- !ruby/object:Gem::Dependency
|
|
49
|
-
name:
|
|
44
|
+
name: rake
|
|
50
45
|
requirement: !ruby/object:Gem::Requirement
|
|
51
|
-
none: false
|
|
52
46
|
requirements:
|
|
53
|
-
- -
|
|
47
|
+
- - ">="
|
|
54
48
|
- !ruby/object:Gem::Version
|
|
55
49
|
version: '0'
|
|
56
50
|
type: :development
|
|
57
51
|
prerelease: false
|
|
58
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
|
-
none: false
|
|
60
53
|
requirements:
|
|
61
|
-
- -
|
|
54
|
+
- - ">="
|
|
62
55
|
- !ruby/object:Gem::Version
|
|
63
56
|
version: '0'
|
|
64
57
|
- !ruby/object:Gem::Dependency
|
|
65
58
|
name: thin
|
|
66
59
|
requirement: !ruby/object:Gem::Requirement
|
|
67
|
-
none: false
|
|
68
60
|
requirements:
|
|
69
|
-
- -
|
|
61
|
+
- - ">="
|
|
70
62
|
- !ruby/object:Gem::Version
|
|
71
63
|
version: '0'
|
|
72
64
|
type: :development
|
|
73
65
|
prerelease: false
|
|
74
66
|
version_requirements: !ruby/object:Gem::Requirement
|
|
75
|
-
none: false
|
|
76
67
|
requirements:
|
|
77
|
-
- -
|
|
68
|
+
- - ">="
|
|
78
69
|
- !ruby/object:Gem::Version
|
|
79
70
|
version: '0'
|
|
80
71
|
description:
|
|
@@ -83,17 +74,17 @@ executables: []
|
|
|
83
74
|
extensions: []
|
|
84
75
|
extra_rdoc_files: []
|
|
85
76
|
files:
|
|
77
|
+
- lib/thrift_client.rb
|
|
86
78
|
- lib/thrift_client/abstract_thrift_client.rb
|
|
79
|
+
- lib/thrift_client/connection.rb
|
|
87
80
|
- lib/thrift_client/connection/base.rb
|
|
88
81
|
- lib/thrift_client/connection/factory.rb
|
|
89
82
|
- lib/thrift_client/connection/http.rb
|
|
90
83
|
- lib/thrift_client/connection/socket.rb
|
|
91
|
-
- lib/thrift_client/connection.rb
|
|
92
84
|
- lib/thrift_client/event_machine.rb
|
|
93
85
|
- lib/thrift_client/server.rb
|
|
94
86
|
- lib/thrift_client/simple.rb
|
|
95
87
|
- lib/thrift_client/thrift.rb
|
|
96
|
-
- lib/thrift_client.rb
|
|
97
88
|
- test/greeter/greeter.rb
|
|
98
89
|
- test/greeter/server.rb
|
|
99
90
|
- test/multiple_working_servers_test.rb
|
|
@@ -104,33 +95,33 @@ files:
|
|
|
104
95
|
homepage: https://github.com/twitter/thrift_client
|
|
105
96
|
licenses:
|
|
106
97
|
- Apache 2.0
|
|
98
|
+
metadata: {}
|
|
107
99
|
post_install_message:
|
|
108
100
|
rdoc_options: []
|
|
109
101
|
require_paths:
|
|
110
102
|
- lib
|
|
111
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
|
-
none: false
|
|
113
104
|
requirements:
|
|
114
|
-
- -
|
|
105
|
+
- - ">="
|
|
115
106
|
- !ruby/object:Gem::Version
|
|
116
107
|
version: '0'
|
|
117
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
|
-
none: false
|
|
119
109
|
requirements:
|
|
120
|
-
- -
|
|
110
|
+
- - ">="
|
|
121
111
|
- !ruby/object:Gem::Version
|
|
122
112
|
version: '0'
|
|
123
113
|
requirements: []
|
|
124
114
|
rubyforge_project:
|
|
125
|
-
rubygems_version:
|
|
115
|
+
rubygems_version: 2.2.5
|
|
126
116
|
signing_key:
|
|
127
|
-
specification_version:
|
|
117
|
+
specification_version: 4
|
|
128
118
|
summary: A Thrift client wrapper that encapsulates some common failover behavior.
|
|
129
119
|
test_files:
|
|
130
120
|
- test/greeter/greeter.rb
|
|
131
121
|
- test/greeter/server.rb
|
|
132
|
-
- test/multiple_working_servers_test.rb
|
|
133
122
|
- test/simple_test.rb
|
|
134
|
-
- test/
|
|
123
|
+
- test/multiple_working_servers_test.rb
|
|
135
124
|
- test/thrift_client_http_test.rb
|
|
125
|
+
- test/test_helper.rb
|
|
136
126
|
- test/thrift_client_test.rb
|
|
127
|
+
has_rdoc:
|