hastats 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,20 +6,13 @@ class HAStats::Socket
6
6
  @socket_addr = socket_addr
7
7
  end
8
8
 
9
- def socket
10
- @socket ||= UNIXSocket.new(socket_addr)
11
- end
12
-
13
- def reset
14
- @socket = nil
15
- end
16
-
17
9
  def run(cmd)
18
- reset
19
- socket.puts(cmd)
20
10
  result = ""
21
- while out = socket.gets
22
- result += out
11
+ UNIXSocket.open(socket_addr) do |socket|
12
+ socket.puts(cmd)
13
+ while out = socket.gets
14
+ result += out
15
+ end
23
16
  end
24
17
  result
25
18
  end
@@ -1,4 +1,4 @@
1
1
  module HAStats
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hastats
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Travis Petticrew
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-04 00:00:00 Z
18
+ date: 2011-10-06 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  prerelease: false