opswalrus 1.0.93 → 1.0.95
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/Gemfile.lock +1 -1
- data/lib/opswalrus/app.rb +2 -1
- data/lib/opswalrus/interaction_handlers.rb +2 -2
- data/lib/opswalrus/ops_file_script_dsl.rb +1 -1
- data/lib/opswalrus/runtime_environment.rb +1 -1
- data/lib/opswalrus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95840cd4d5d5c4e6931039eb2fa780183c17a6c88fde247f8d425855d0a2ff0e
|
4
|
+
data.tar.gz: 97ba07f54f39a995982edd6f0ac6497d22b6c3063763379d06a4a9294620b583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc97ad6aa85c13f9fc990d57754e6930464c7a7a4379bb7342ae73ac9cbd75ceb5fb8e9311b28dbdfd896b90b7e0fb068398ce9868e22b35f689611a1f24079d
|
7
|
+
data.tar.gz: 74f423605ce4dbe496c839fa93fed03cf6ae7c49bbbe12fa655b7bfe187af1221d007263819f9cce0cb1f222ee15c37787aff2492a3737bab281b9dff87ac23f
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/app.rb
CHANGED
@@ -25,6 +25,7 @@ require_relative "version"
|
|
25
25
|
|
26
26
|
module OpsWalrus
|
27
27
|
Style = Pastel.new(enabled: $stdout.tty?)
|
28
|
+
DefaultLookbackWindowCharCount = 2000
|
28
29
|
|
29
30
|
class App
|
30
31
|
def self.instance(*args)
|
@@ -228,7 +229,7 @@ module OpsWalrus
|
|
228
229
|
internal_ops_file = OpsFile.new(self, __FILE__.to_pathname.dirname.join(ops_file_name))
|
229
230
|
op = OperationRunner.new(self, internal_ops_file)
|
230
231
|
result = op.run([], params_json_hash: params)
|
231
|
-
puts "result class=#{result.class}"
|
232
|
+
# puts "result class=#{result.class}"
|
232
233
|
exit_status = result.exit_status
|
233
234
|
stdout = JSON.pretty_generate(result.value)
|
234
235
|
output = if exit_status == 0
|
@@ -9,7 +9,7 @@ module OpsWalrus
|
|
9
9
|
|
10
10
|
attr_accessor :input_mappings # Hash[ String | Regex => (String | Proc) ]
|
11
11
|
|
12
|
-
def initialize(mappings, lookback_window_chars =
|
12
|
+
def initialize(mappings, lookback_window_chars = DefaultLookbackWindowCharCount)
|
13
13
|
@input_mappings = mappings
|
14
14
|
@online_matcher = Kleene::NaiveOnlineRegex.new(mappings.keys, lookback_window_chars)
|
15
15
|
end
|
@@ -42,7 +42,7 @@ module OpsWalrus
|
|
42
42
|
# when the given block returns, then the temporary mapping is removed from the interaction handler
|
43
43
|
#
|
44
44
|
# mapping : Hash[ String | Regex => (String | Proc) ] | Nil
|
45
|
-
def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, lookback_window_chars:
|
45
|
+
def with_mapping(mapping = nil, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, lookback_window_chars: DefaultLookbackWindowCharCount)
|
46
46
|
new_mapping = inherit_existing_mappings ? @input_mappings.clone : {}
|
47
47
|
|
48
48
|
if mapping
|
@@ -303,7 +303,7 @@ module OpsWalrus
|
|
303
303
|
if App.instance.dry_run?
|
304
304
|
["", "", 0]
|
305
305
|
else
|
306
|
-
sshkit_cmd = @runtime_env.handle_input(input, inherit_existing_mappings: true, lookback_window_chars:
|
306
|
+
sshkit_cmd = @runtime_env.handle_input(input, inherit_existing_mappings: true, lookback_window_chars: DefaultLookbackWindowCharCount) do |interaction_handler|
|
307
307
|
# puts "self=#{self.class.superclass}"
|
308
308
|
# self is an instance of one of the dynamically defined subclasses of OpsFileScript
|
309
309
|
App.instance.debug("OpsFileScriptDSL#shell! cmd=#{cmd} with input mappings #{interaction_handler.input_mappings.inspect} given input: #{input.inspect})")
|
@@ -267,7 +267,7 @@ module OpsWalrus
|
|
267
267
|
|
268
268
|
# input_mapping : Hash[ String | Regex => String ]
|
269
269
|
# sudo_password : String
|
270
|
-
def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, lookback_window_chars:
|
270
|
+
def handle_input(input_mapping, sudo_password: nil, ops_sudo_password: nil, inherit_existing_mappings: true, lookback_window_chars: DefaultLookbackWindowCharCount, &block)
|
271
271
|
@interaction_handler.with_mapping(
|
272
272
|
input_mapping,
|
273
273
|
sudo_password: sudo_password,
|
data/lib/opswalrus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opswalrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.95
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ellis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|