xlogin 0.5.10 → 0.5.13
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 +4 -4
- data/.gitignore +1 -2
- data/lib/xlogin/session.rb +12 -5
- data/lib/xlogin/templates/ios.rb +0 -1
- data/lib/xlogin/templates/iosxr.rb +0 -1
- data/lib/xlogin/templates/junos.rb +0 -1
- data/lib/xlogin/templates/sros.rb +0 -1
- data/lib/xlogin/version.rb +1 -1
- data/xlogin.gemspec +2 -2
- metadata +8 -6
- data/Gemfile.lock +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28fe38cadeb9382c1dca21cc77a8cc5d5233ea2b
|
4
|
+
data.tar.gz: 4d9075c3216fb035d8c8b0407e99f67b35e0dd0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc38702bc86c7b0f416a4688f7b0a3b8d8d949dfa59371e255198dac36edb09a497b321ab8242b766dbd9f9c1313d566ae18aaeaf567f15737ca6aa02f3cb9aa
|
7
|
+
data.tar.gz: 4a7f58d4699f7a70941d1cc32ccdff906791f3ad820676fefe403e4ecb935acc7e28c42feb7ea1b7efe75f1134e42505bb95d5b7d9c7434afddde626d23a3460
|
data/.gitignore
CHANGED
@@ -43,6 +43,7 @@ build-iPhoneSimulator/
|
|
43
43
|
/.bundle/
|
44
44
|
/vendor/bundle
|
45
45
|
/lib/bundler/man/
|
46
|
+
/Gemfile.lock
|
46
47
|
|
47
48
|
# for a library or gem, you might want to ignore these files since the code is
|
48
49
|
# intended to run in multiple environments; otherwise, check them in:
|
@@ -54,8 +55,6 @@ build-iPhoneSimulator/
|
|
54
55
|
.rvmrc
|
55
56
|
|
56
57
|
# End of https://www.gitignore.io/api/ruby
|
57
|
-
/lib/xlogin/.xloginrc
|
58
|
-
/lib/xlogin/_xloginrc
|
59
58
|
/lib/xlogin/templates/*
|
60
59
|
!/lib/xlogin/templates/vyos.rb
|
61
60
|
!/lib/xlogin/templates/junos.rb
|
data/lib/xlogin/session.rb
CHANGED
@@ -17,21 +17,28 @@ module Xlogin
|
|
17
17
|
raise ArgumentError.new('device hostname or port not specified.') unless @host && @port
|
18
18
|
|
19
19
|
@prompts = @opts[:prompts] || [[/[$%#>] ?\z/n, nil]]
|
20
|
-
@timeout = @opts[:timeout] ||
|
20
|
+
@timeout = @opts[:timeout] || 10
|
21
21
|
|
22
22
|
@loglist = [@opts[:log]].flatten.compact
|
23
23
|
@logger = update_logger
|
24
24
|
end
|
25
25
|
|
26
|
-
def waitfor(*expect)
|
26
|
+
def waitfor(*expect, &block)
|
27
27
|
if expect.compact.empty?
|
28
|
-
super(Regexp.union(*@prompts.map(&:first))
|
28
|
+
super(Regexp.union(*@prompts.map(&:first))) do |recvdata|
|
29
|
+
@logger.call(recvdata)
|
30
|
+
block.call(recvdata) if block
|
31
|
+
end
|
29
32
|
else
|
30
|
-
line = super(*expect
|
33
|
+
line = super(*expect) do |recvdata|
|
34
|
+
@logger.call(recvdata)
|
35
|
+
block.call(recvdata) if block
|
36
|
+
end
|
37
|
+
|
31
38
|
_, process = @prompts.find { |r, p| r =~ line && p }
|
32
39
|
if process
|
33
40
|
instance_eval(&process)
|
34
|
-
line += waitfor(*expect)
|
41
|
+
line += waitfor(*expect, &block)
|
35
42
|
end
|
36
43
|
line
|
37
44
|
end
|
data/lib/xlogin/templates/ios.rb
CHANGED
data/lib/xlogin/version.rb
CHANGED
data/xlogin.gemspec
CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
27
|
f.match(%r{^(test|spec|features)/})
|
28
28
|
end
|
29
|
-
spec.bindir = "
|
30
|
-
spec.executables = spec.files.grep(%r{^
|
29
|
+
spec.bindir = "bin"
|
30
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
33
|
spec.add_dependency "net-telnet"
|
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.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- haccht
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-telnet
|
@@ -111,14 +111,16 @@ dependencies:
|
|
111
111
|
description: login to any devices with ease.
|
112
112
|
email:
|
113
113
|
- haccht@users.noreply.github.com
|
114
|
-
executables:
|
114
|
+
executables:
|
115
|
+
- console
|
116
|
+
- setup
|
117
|
+
- xlogin
|
115
118
|
extensions: []
|
116
119
|
extra_rdoc_files: []
|
117
120
|
files:
|
118
121
|
- ".gitignore"
|
119
122
|
- CODE_OF_CONDUCT.md
|
120
123
|
- Gemfile
|
121
|
-
- Gemfile.lock
|
122
124
|
- LICENSE.txt
|
123
125
|
- README.md
|
124
126
|
- Rakefile
|
@@ -163,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
165
|
version: '0'
|
164
166
|
requirements: []
|
165
167
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.6.11
|
167
169
|
signing_key:
|
168
170
|
specification_version: 4
|
169
171
|
summary: rancid clogin alternative
|
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
xlogin (0.5.10)
|
5
|
-
net-ssh
|
6
|
-
net-ssh-gateway
|
7
|
-
net-ssh-telnet
|
8
|
-
net-telnet
|
9
|
-
parallel
|
10
|
-
|
11
|
-
GEM
|
12
|
-
remote: https://rubygems.org/
|
13
|
-
specs:
|
14
|
-
net-ssh (4.2.0)
|
15
|
-
net-ssh-gateway (2.0.0)
|
16
|
-
net-ssh (>= 4.0.0)
|
17
|
-
net-ssh-telnet (0.2.0)
|
18
|
-
net-ssh (>= 2.0.1)
|
19
|
-
net-telnet (0.1.1)
|
20
|
-
parallel (1.12.0)
|
21
|
-
rake (10.5.0)
|
22
|
-
|
23
|
-
PLATFORMS
|
24
|
-
ruby
|
25
|
-
|
26
|
-
DEPENDENCIES
|
27
|
-
bundler (~> 1.13)
|
28
|
-
rake (~> 10.0)
|
29
|
-
xlogin!
|
30
|
-
|
31
|
-
BUNDLED WITH
|
32
|
-
1.15.3
|