sshake 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sshake/base_session.rb +5 -1
- data/lib/sshake/execution_options.rb +5 -0
- data/lib/sshake/session.rb +3 -3
- data/lib/sshake/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af9f1f3daa52b3136755fa4d2578825c2862aa4c18eaa04b483f52a50b70036
|
4
|
+
data.tar.gz: 151058a1bf0d2f28dc721fe1ad9fc1c3dca8ecdaa58a4658903ef2e6b70fe7b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9962e5b2b8c0d96bdc94a01d85685e6c1cd1f141ce9c6edbe8f88d04af67151c95f94127409c83427e33b93fdf12abf856dd38943266b9603edcc2b214f79393
|
7
|
+
data.tar.gz: 607754279f740459b74faa80cbf96755c97ab79ab5682be245e252330ae149a916d7f7834f98585fb44d6857121d81fb3b64056e4f4d1348d71bcdc183c162f7
|
data/lib/sshake/base_session.rb
CHANGED
@@ -23,7 +23,7 @@ module SSHake
|
|
23
23
|
# @return [Boolean]
|
24
24
|
attr_accessor :raise_on_error
|
25
25
|
|
26
|
-
def initialize(*_args, klogger: nil, **
|
26
|
+
def initialize(*_args, klogger: nil, **_options)
|
27
27
|
@id = SecureRandom.hex(4)
|
28
28
|
@klogger = klogger || SSHake.klogger
|
29
29
|
end
|
@@ -81,6 +81,10 @@ module SSHake
|
|
81
81
|
raise Error, 'You cannot provide a block and options'
|
82
82
|
end
|
83
83
|
|
84
|
+
if hash.is_a?(ExecutionOptions)
|
85
|
+
return hash
|
86
|
+
end
|
87
|
+
|
84
88
|
if block
|
85
89
|
ExecutionOptions.from_block(&block)
|
86
90
|
elsif hash.is_a?(Hash)
|
data/lib/sshake/session.rb
CHANGED
@@ -23,10 +23,10 @@ module SSHake
|
|
23
23
|
# Create a new SSH session
|
24
24
|
#
|
25
25
|
# @return [Sshake::Session]
|
26
|
-
def initialize(host,
|
26
|
+
def initialize(host, user = nil, **options)
|
27
27
|
super
|
28
28
|
@host = host
|
29
|
-
@
|
29
|
+
@user = user
|
30
30
|
@session_options = options
|
31
31
|
@session_options.delete(:klogger)
|
32
32
|
end
|
@@ -91,7 +91,7 @@ module SSHake
|
|
91
91
|
def execute(commands, options = nil, &block)
|
92
92
|
options = create_options(options, block)
|
93
93
|
command_to_execute = prepare_commands(commands, options)
|
94
|
-
|
94
|
+
|
95
95
|
# Execute the command
|
96
96
|
response = Response.new
|
97
97
|
response.command = command_to_execute
|
data/lib/sshake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sshake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: klogger-logger
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.5.9
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: A wrapper for net/ssh to make running commands more fun
|