net-ssh-cli 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/net/ssh/cli/version.rb +1 -1
- data/lib/net/ssh/cli.rb +10 -10
- data/net-ssh-cli.gemspec +17 -17
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7056a8a1973f705133135914df49d4b16e1b9213b35b987677094b9993b3b059
|
4
|
+
data.tar.gz: 5520b049f17149f5a17849f396b150451a0b7f50f0ceee4e79d616f23ec876e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5d34700dc16a246ce3706828d2043993b34496d5b1a742f5dbbff366a62591ae2327bf7f9a1ec0044281962ae65f7f6297f2b49025f4acc1ba2175d2004ae12
|
7
|
+
data.tar.gz: 0231d51bb361bbb6181138d1f0ec3350071c804f06e0e863bbe9d97fb85e5e9a156019f0fb6e7332a3e36baeda0d67050f34bbe519b275d8b0fa4c5439331878
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.1
|
data/lib/net/ssh/cli/version.rb
CHANGED
data/lib/net/ssh/cli.rb
CHANGED
@@ -44,19 +44,19 @@ module Net
|
|
44
44
|
cmd_rm_prompt: false, # whether the prompt should be removed in the output of #cmd
|
45
45
|
cmd_rm_command: false, # whether the given command should be removed in the output of #cmd
|
46
46
|
cmd_rm_command_tail: "\n", # which format does the end of line return after a command has been submitted. Could be something like "ls\n" "ls\r\n" or "ls \n" (extra spaces)
|
47
|
-
cmd_minimum_duration: 0, # how long do you want to wait/sleep after sending the command. After this waiting time, the output will be processed and the prompt will be searched.
|
47
|
+
cmd_minimum_duration: 0, # how long do you want to wait/sleep after sending the command. After this waiting time, the output will be processed and the prompt will be searched.
|
48
48
|
run_impact: false, # whether to run #impact commands. This might align with testing|development|production. example #impact("reboot")
|
49
49
|
read_till_timeout: nil, # timeout for #read_till to find the match
|
50
50
|
read_till_hard_timeout: nil, # hard timeout for #read_till to find the match using Timeout.timeout(hard_timeout) {}. Might creates unpredicted sideffects
|
51
51
|
read_till_hard_timeout_factor: 1.2, # hard timeout factor in case read_till_hard_timeout is true
|
52
|
-
named_prompts: ActiveSupport::HashWithIndifferentAccess.new, # you can used named prompts for #with_prompt {}
|
53
|
-
before_cmd_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before #cmd
|
52
|
+
named_prompts: ActiveSupport::HashWithIndifferentAccess.new, # you can used named prompts for #with_prompt {}
|
53
|
+
before_cmd_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before #cmd
|
54
54
|
after_cmd_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call after #cmd
|
55
|
-
before_on_stdout_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before data arrives from the underlying connection
|
55
|
+
before_on_stdout_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before data arrives from the underlying connection
|
56
56
|
after_on_stdout_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call after data arrives from the underlying connection
|
57
|
-
before_on_stdin_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before data is sent to the underlying channel
|
57
|
+
before_on_stdin_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before data is sent to the underlying channel
|
58
58
|
after_on_stdin_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call after data is sent to the underlying channel
|
59
|
-
before_open_channel_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before opening a channel
|
59
|
+
before_open_channel_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call before opening a channel
|
60
60
|
after_open_channel_procs: ActiveSupport::HashWithIndifferentAccess.new, # procs to call after opening a channel, for example you could call #detect_prompt or #read_till
|
61
61
|
open_channel_timeout: nil, # timeout to open the channel
|
62
62
|
net_ssh_options: ActiveSupport::HashWithIndifferentAccess.new, # a wrapper for options to pass to Net::SSH.start in case net_ssh is undefined
|
@@ -297,7 +297,7 @@ module Net
|
|
297
297
|
# removes the prompt from the given output
|
298
298
|
# prompt should contain a named match 'prompt' /(?<prompt>.*something.*)\z/
|
299
299
|
# for backwards compatibility it also tries to replace the first match of the prompt /(something)\z/
|
300
|
-
# it removes the whole match if no matches are given /something\z/
|
300
|
+
# it removes the whole match if no matches are given /something\z/
|
301
301
|
def rm_prompt!(output, prompt: current_prompt, **opts)
|
302
302
|
if rm_prompt?(**opts)
|
303
303
|
if output[prompt]
|
@@ -320,10 +320,10 @@ module Net
|
|
320
320
|
|
321
321
|
# the same as #cmd but it will only run the command if the option run_impact is set to true.
|
322
322
|
# this can be used for commands which you might not want to run in development|testing mode but in production
|
323
|
-
# cli.impact("reboot")
|
323
|
+
# cli.impact("reboot")
|
324
324
|
# => "skip: reboot"
|
325
325
|
# cli.run_impact = true
|
326
|
-
# cli.impact("reboot")
|
326
|
+
# cli.impact("reboot")
|
327
327
|
# => "system is going to reboot NOW"
|
328
328
|
def impact(command, **opts)
|
329
329
|
run_impact? ? cmd(command, **opts) : "skip: #{command.inspect}"
|
@@ -360,7 +360,7 @@ module Net
|
|
360
360
|
return @net_ssh if @net_ssh
|
361
361
|
|
362
362
|
logger.debug { 'Net:SSH #start' }
|
363
|
-
self.net_ssh = Net::SSH.start(net_ssh_options[:ip] || net_ssh_options[:host] || 'localhost', net_ssh_options[:user] || ENV['USER'], formatted_net_ssh_options)
|
363
|
+
self.net_ssh = Net::SSH.start(net_ssh_options[:ip] || net_ssh_options[:host] || 'localhost', net_ssh_options[:user] || ENV['USER'], **formatted_net_ssh_options)
|
364
364
|
rescue StandardError => error
|
365
365
|
self.net_ssh = nil
|
366
366
|
raise
|
data/net-ssh-cli.gemspec
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "net/ssh/cli/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = "net-ssh-cli"
|
9
9
|
spec.version = Net::SSH::CLI::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
10
|
+
spec.authors = ["Fabian Stillhart"]
|
11
|
+
spec.email = ["fabian.stillhart1@swisscom.com"]
|
12
12
|
|
13
|
-
spec.summary =
|
14
|
-
spec.description =
|
15
|
-
spec.homepage =
|
16
|
-
spec.license =
|
13
|
+
spec.summary = "Net::SSH::CLI: A library to handle CLI Sessions"
|
14
|
+
spec.description = "Net::SSH::CLI: A library to handle CLI Sessions. It allows you to write programs that invoke and interact with (long-running) CLI Sessions via NET::SSH."
|
15
|
+
spec.homepage = "https://github.com/swisscom/net-ssh-cli"
|
16
|
+
spec.license = "MIT"
|
17
17
|
|
18
18
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
19
19
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
@@ -33,14 +33,14 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
34
34
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
35
35
|
end
|
36
|
-
spec.bindir =
|
36
|
+
spec.bindir = "exe"
|
37
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
|
-
spec.require_paths = [
|
38
|
+
spec.require_paths = ["lib"]
|
39
39
|
|
40
|
-
spec.add_development_dependency
|
41
|
-
spec.add_development_dependency
|
42
|
-
spec.add_development_dependency
|
43
|
-
spec.add_development_dependency
|
44
|
-
spec.add_dependency
|
45
|
-
spec.add_dependency
|
40
|
+
spec.add_development_dependency "bump"
|
41
|
+
spec.add_development_dependency "bundler"
|
42
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
43
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
44
|
+
spec.add_dependency "activesupport", ">= 4.0"
|
45
|
+
spec.add_dependency "net-ssh", ">= 7.0"
|
46
46
|
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabian Stillhart
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bump
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '7.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '7.0'
|
97
97
|
description: 'Net::SSH::CLI: A library to handle CLI Sessions. It allows you to write
|
98
98
|
programs that invoke and interact with (long-running) CLI Sessions via NET::SSH.'
|
99
99
|
email:
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.3.25
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: 'Net::SSH::CLI: A library to handle CLI Sessions'
|