thrifter 0.1.1 → 0.1.2

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: d17b3472039110ba6cb2226fb72e0ed490f3a0a9
4
- data.tar.gz: 0dc804e6e5de0d3e3107961d5841ca834db39d29
3
+ metadata.gz: 4d4d2c07c4f438c528cbee2fb79eaaad32d492e0
4
+ data.tar.gz: 04118a2ca3fdc79444b6454ab63897344ab09ae2
5
5
  SHA512:
6
- metadata.gz: ce63b7eae7e10ad4caa724be4ef43082b0673ebe54c734cd95f3a273fbae579b694769b9c377ad3671fd33b77dd31d7b5d81da15bc84d9399a20ed8df9f45d11
7
- data.tar.gz: 7d8f048ee242cf2dcdf03a4091f0ed3694e6b5a14fdaf0fed0019031ab0aee03cde8d0a2cc566921879c9a70ea4c7002452238fb2e14df704633d1a0fafb5e7d
6
+ metadata.gz: 57afa5cab7442e4af1bb49cc35b856ebadc9dd94fe83cb36daf069042ad8ac93e368793b376410e1da3539adbd87cbf3db0a809b957279a9e6c7b9971db9b0e7
7
+ data.tar.gz: d99656e443fbf32b2a16fc805d211d92549b06e69b58480961c6f823775ed2071a0afb6ea755f8d3b505b911ccc2e36f56881b7495737d786e4a7d392e2f35a0
data/lib/thrifter.rb CHANGED
@@ -126,12 +126,12 @@ module Thrifter
126
126
  end
127
127
 
128
128
  def initialize(client = nil)
129
- if client.nil?
129
+ if !client
130
130
  fail ArgumentError, 'config.uri not set!' unless config.uri
131
131
 
132
- uri = URI(config.uri)
132
+ @uri = URI(config.uri)
133
133
 
134
- fail ArgumentError, 'URI did not contain port' unless uri.port
134
+ fail ArgumentError, 'URI did not contain port' unless @uri.port
135
135
  end
136
136
 
137
137
  @pool = ConnectionPool.new size: config.pool_size.to_i, timeout: config.pool_timeout.to_f do
@@ -144,14 +144,14 @@ module Thrifter
144
144
  # application may have configured.
145
145
  stack.use Metrics, config.statsd
146
146
 
147
- if client.nil?
148
- socket = Thrift::Socket.new uri.host, uri.port, config.rpc_timeout.to_f
147
+ if client
148
+ stack.use DirectDispatcher, client
149
+ else
150
+ socket = Thrift::Socket.new @uri.host, @uri.port, config.rpc_timeout.to_f
149
151
  transport = config.transport.new socket
150
152
  protocol = config.protocol.new transport
151
153
 
152
154
  stack.use Dispatcher, transport, client_class.new(protocol)
153
- else
154
- stack.use DirectDispatcher, client
155
155
  end
156
156
 
157
157
  stack.finalize!
@@ -1,3 +1,3 @@
1
1
  module Thrifter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrifter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ahawkins