fleet 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/fleet.rb +4 -2
  2. metadata +1 -1
data/lib/fleet.rb CHANGED
@@ -6,14 +6,16 @@ class Fleet
6
6
  @host = host
7
7
  @port = port
8
8
  @socket = TCPSocket.new(host, port)
9
+ @json_encoder = Yajl::Encoder
10
+ @json_parser = Yajl::Parser
9
11
  end
10
12
 
11
13
  def query(q)
12
- request = Yajl::Encoder.encode(q)
14
+ request = @json_encoder.encode(q)
13
15
  @socket.write(request)
14
16
  @socket.write("\r\n")
15
17
  response = @socket.gets
16
- status, value = Yajl::Parser.parse(response)
18
+ status, value = @json_parser.parse(response)
17
19
  status == 0 ? value : raise(value)
18
20
  end
19
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fleet
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
  - Mark McGranaghan