allq 0.3.7 → 0.3.8

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: d7dd01c885385253c38b1b870d851064cb4b0c05
4
- data.tar.gz: defbee1be035ee2fcf53d3ca800a5da584f6d1d9
3
+ metadata.gz: 5a179d72534b0a07bb5b87d02bc7447a48078213
4
+ data.tar.gz: d96e35f43118aa616418072ac35a121a757ee472
5
5
  SHA512:
6
- metadata.gz: c5468daa916cd29914970257352e7a801462eb120ceb4e0ddf70c3c9fea1b4405d1e194c92db140688a178e8d9827a8bee3c90288481057fb8a05e7c0f5ac414
7
- data.tar.gz: 1017eb6df7c0b396db689b289a52f8721733e602d47ee07aa2e88bba44ff40b279bc895ba35c64fcb97a3cfc31cb4418402e6002f4968b094fbf065576f5596e
6
+ metadata.gz: 31c4823fe3be1fa669e8316f328482e7f2651f23bd18cb388f0fac52b769ab13b957efd68dfee915a363d343c7612f10ebafeccd6d46b0a0bd8af369c768ef88
7
+ data.tar.gz: 06a81172215aece6a413fe9de35f4f7fbab2cbe00a4664c746ab7fc8642cb6f2350354a84e8c7c35ce970afbfa8388802c2d56847245fdac5ef63a2c2467cfc7
@@ -46,8 +46,8 @@ class AllQ
46
46
  yield block.call(res)
47
47
  end
48
48
 
49
- def call_socat(data)
50
- cmd_string = "echo '#{data}' | socat - tcp4-connect:#{@address}"
49
+ def call_socat(data, timeout = 1.0)
50
+ cmd_string = "echo '#{data}' | socat -t #{timeout} - tcp4-connect:#{@address}"
51
51
  output = `#{cmd_string}`
52
52
  return output
53
53
  end
@@ -64,9 +64,7 @@ class AllQ
64
64
  def transmit(command, options={}, &block)
65
65
  _with_retry(options[:retry_interval], options[:init]) do
66
66
  @mutex.synchronize do
67
- _raise_not_connected! unless @connection && !@connection.closed?
68
- @connection.puts(command.to_s)
69
- res = @connection.readline
67
+ res = call_socat(command.to_s, 20.0)
70
68
  yield block.call(res)
71
69
  end
72
70
  end
@@ -1,3 +1,3 @@
1
1
  module Allq
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-18 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler