thrift_rack 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/thrift_rack/http_client_transport.rb +2 -0
- data/lib/thrift_rack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 773b0e6d88aa7f1985166dc435f1a86e060a37a9
|
4
|
+
data.tar.gz: 6086c1097e403a8d0b9a7905a714f2f36e2562e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2846261de0e9c65282acd06787d01cb167a2523afa544cf395ad089b643769c5c138e033cf1b0eac327ca75502b416d07860867da673711982809ed5e9490a0d
|
7
|
+
data.tar.gz: 933c12c2164c69cd3dcf42507c81edfe0e882435139ebd87620826fabaa875dd4eb950477f855e57dfcc90f0ff92803951180b75decb196defd6b4090e088759
|
data/Gemfile.lock
CHANGED
@@ -4,6 +4,7 @@ require "stringio"
|
|
4
4
|
Excon.defaults[:ssl_verify_peer] = false
|
5
5
|
class ThriftRack
|
6
6
|
class HttpClientTransport < Thrift::BaseTransport
|
7
|
+
class RespCodeError < StandardError; end
|
7
8
|
def initialize(client, path, opts = {})
|
8
9
|
@headers = {'Content-Type' => 'application/x-thrift'}
|
9
10
|
@outbuf = Thrift::Bytes.empty_byte_buffer
|
@@ -23,6 +24,7 @@ class ThriftRack
|
|
23
24
|
def flush
|
24
25
|
resp = @client.post(path: @path, body: @outbuf, headers: @headers, idempotent: true)
|
25
26
|
data = resp.body
|
27
|
+
raise RespCodeError.new("#{resp.status} on #{@path} with body #{data}") unless resp.status == 200
|
26
28
|
data = Thrift::Bytes.force_binary_encoding(data)
|
27
29
|
@inbuf = StringIO.new data
|
28
30
|
ensure
|
data/lib/thrift_rack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thrift_rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xuxiangyang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|