xelnex 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12735577d5dec08de27499ad5e9c9d1372e17d07
4
- data.tar.gz: 632e41ec1978fda1dc2d9e9705abbc1375530848
3
+ metadata.gz: b9115d5bb5b0d97fcc17cdbcc6fca5c96eddefcc
4
+ data.tar.gz: 6123079c64b6ca8af20b2087cb2638954cf3d6f8
5
5
  SHA512:
6
- metadata.gz: c14ffa4d6cd9263b1fe60ee21736a748e3998c8365de99abc7d6b2ad8e9f17eb2f4ef52d351ce8b4c7b3f1de4a97c4d6dfaf3bece7f3858bac9b0bfedae7b578
7
- data.tar.gz: 94952d41c834583b51895c69c7f6886646af9bae569a867d6b1b7938aaa517e9661bcc72ce7a6f2247ffed35225e05e77fdf5b9bef2c0a681e906617f3b57e7b
6
+ metadata.gz: 18449f125a49fa033a0584172865fa971e0196f4d0b111400c2ff9c163154cbead28690b4ced5d6ea34588219387e471cf7957e017ad0597c483168f67322da8
7
+ data.tar.gz: 46c45ec8bb67de6133db3548a9382587fc298df5466e3825e44869f06bb995de44caadfab75b3b018837ce8dd4ecab34f837cdc788ffe740a125fb77df7388ee
data/bin/xelnex CHANGED
@@ -4,6 +4,7 @@ require "xelnex"
4
4
 
5
5
  puts "Xelnex"
6
6
  xelnex = Xelnex::Handler.new
7
+ xelnex.timeout = ENV['TIMEOUT'].to_f if ENV['TIMEOUT']
7
8
 
8
9
  def handle_input(xelnex, input)
9
10
  result = xelnex.handle(input)
@@ -4,6 +4,8 @@ require "timeout"
4
4
 
5
5
  module Xelnex
6
6
  class Handler
7
+ attr_accessor :timeout
8
+
7
9
  def handle(input)
8
10
  if connected
9
11
  send_line(input)
@@ -39,7 +41,7 @@ module Xelnex
39
41
  "".tap do |result|
40
42
  begin
41
43
  loop do
42
- Timeout::timeout(1.5) do
44
+ Timeout::timeout(self.timeout || 0.1) do
43
45
  ans = recv_con.gets
44
46
  result << ans
45
47
  end
@@ -1,3 +1,3 @@
1
1
  module Xelnex
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xelnex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Fedorov