xlogin 0.12.8 → 0.12.10

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
  SHA256:
3
- metadata.gz: 2f6d90f1c6962fa4cc37ea57f8a651e58aefa5d404f7d0c585f295d3b65923ff
4
- data.tar.gz: b02c711b8d055c5c883ac9736682083860598299d60075fafc43c3d6e12c468f
3
+ metadata.gz: 3372a9d3f0372508e953e54d2e9d1b2be4f1eefe78b9e35f3357592f19864d65
4
+ data.tar.gz: 9abac3f616288b6d269407445e871a7d79be7798307ee87811ac3badedd0c0f3
5
5
  SHA512:
6
- metadata.gz: 460907878676426a67d607a6594f2597b42c1a3b76a9e26ecdb47c7aab2f6a21ed997020fc265e4176ad8f277b5955be870099d10acc246a3608f52a7ca3718e
7
- data.tar.gz: 67e2b8497b0f1605dc720d9cb0d06ce3661ef2fa2b222bee1fa8e2eab09a062b0fccf6906a80816d23a1831c1667ea0a012734713a27aa63b26f246846894870
6
+ metadata.gz: 1c55eaf08ef9377a62b0c7955298b09d860ce081fd8b8ba50838088480a62af497aed1c40f750531ae9ce9d68fb4167ed8916c10f35caad2850531387717c13d
7
+ data.tar.gz: ab7699c7648457ce1fc59d787d9a22a2ead92fd2c91fff1ff8e738b532e13a18e962fe16de7c943bb8b6664f60a2218266ae4407dcb5fac01939b6a0ad86d25c
@@ -38,7 +38,7 @@ module Xlogin
38
38
  'Username' => @username,
39
39
  'Password' => @password,
40
40
  'Timeout' => @config.timeout || @template.timeout || false,
41
- 'Prompt' => Regexp.union(*@template.prompt.map(&:first)),
41
+ 'Prompt' => prompt_pattern,
42
42
  'FailEOF' => true,
43
43
  )
44
44
  rescue => e
@@ -56,17 +56,21 @@ module Xlogin
56
56
  text.chomp if text
57
57
  end
58
58
 
59
+ def prompt_pattern
60
+ Regexp.union(*@template.prompt.map(&:first))
61
+ end
62
+
59
63
  def duplicate
60
64
  @template.build(@uri, **@config.to_h)
61
65
  end
62
66
 
63
67
  def puts(*args, &block)
64
- args = [instance_exec(*args, &@template.interrupt!)].flatten.compact if @template.interrupt!
68
+ args = args.flat_map { |arg| instance_exec(arg, &@template.interrupt!) }.compact if @template.interrupt!
65
69
  args.empty? ? super('', &block) : super(*args, &block)
66
70
  end
67
71
 
68
72
  def waitfor(*args, &block)
69
- args = [Regexp.union(*@template.prompt.map(&:first))] if args.empty?
73
+ args = [prompt_pattern] if args.empty?
70
74
  @mutex.synchronize { _waitfor(*args, &block) }
71
75
  end
72
76
 
@@ -1,3 +1,3 @@
1
1
  module Xlogin
2
- VERSION = "0.12.8"
2
+ VERSION = "0.12.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlogin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.8
4
+ version: 0.12.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - haccht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-09 00:00:00.000000000 Z
11
+ date: 2019-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-telnet