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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8d65b6b9fa8fd110291952af1d442dc69cc6845f17eaa083d02029c00f158c1
4
- data.tar.gz: 4bd250414e109112c077518dbbe3e59513f0306bf25182797ee47ad95c78339b
3
+ metadata.gz: 1af9f1f3daa52b3136755fa4d2578825c2862aa4c18eaa04b483f52a50b70036
4
+ data.tar.gz: 151058a1bf0d2f28dc721fe1ad9fc1c3dca8ecdaa58a4658903ef2e6b70fe7b6
5
5
  SHA512:
6
- metadata.gz: 3f3f5a61a1d6927818c840894a71f0fc1b3b091201dc818071684f3e4a7a56078b94133c3303c69bac7c7b35da6819c8f03d4a291f74649a8baf3268f755a6d3
7
- data.tar.gz: 73b3e0bb2eca01591aff9835ec858b83d44366a46a2e09aa9eebbb94723d10fff525ec022a7dd83b94891564b3b158c233f405325b26a2611734e8422688fae0
6
+ metadata.gz: 9962e5b2b8c0d96bdc94a01d85685e6c1cd1f141ce9c6edbe8f88d04af67151c95f94127409c83427e33b93fdf12abf856dd38943266b9603edcc2b214f79393
7
+ data.tar.gz: 607754279f740459b74faa80cbf96755c97ab79ab5682be245e252330ae149a916d7f7834f98585fb44d6857121d81fb3b64056e4f4d1348d71bcdc183c162f7
@@ -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, **options)
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)
@@ -5,6 +5,11 @@ require 'sshake/execution_options_dsl'
5
5
  module SSHake
6
6
  class ExecutionOptions
7
7
 
8
+ def initialize
9
+ dsl = ExecutionOptionsDSL.new(self)
10
+ yield dsl if block_given?
11
+ end
12
+
8
13
  # The timeout
9
14
  #
10
15
  # @return [Integer]
@@ -23,10 +23,10 @@ module SSHake
23
23
  # Create a new SSH session
24
24
  #
25
25
  # @return [Sshake::Session]
26
- def initialize(host, username = nil, **options)
26
+ def initialize(host, user = nil, **options)
27
27
  super
28
28
  @host = host
29
- @username = username
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SSHake
4
4
 
5
- VERSION = '2.0.1'
5
+ VERSION = '2.0.3'
6
6
 
7
7
  end
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.1
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: 2023-03-09 00:00:00.000000000 Z
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.2.32
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