opswalrus 1.0.93 → 1.0.95

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: a41fcb970962e18713c8687bb1d3226944e74cc052dcf2815b23bc86bd82a422
4
- data.tar.gz: 03fd0fbcdae90f715dea4b80ec3eb0f367eec93c9c94db9bf314e98aea66c383
3
+ metadata.gz: 95840cd4d5d5c4e6931039eb2fa780183c17a6c88fde247f8d425855d0a2ff0e
4
+ data.tar.gz: 97ba07f54f39a995982edd6f0ac6497d22b6c3063763379d06a4a9294620b583
5
5
  SHA512:
6
- metadata.gz: 4e9d0a83c0bbc5f4295986d3e941263f9579cce257f606c64f62e44826ea8a1b5cb05b86fbbefe0034536ec4cf5266f5c72a889e409b07d502cd2d1309ccfe2c
7
- data.tar.gz: 111b5fbac2877cbe95f9fca3080e37f5790f9e36b137ef31cfdacda9332d07ec4f5e3986b1afdf9d48f4d53baf8bbba174bd8784c721962294b37f4ec400b345
6
+ metadata.gz: cc97ad6aa85c13f9fc990d57754e6930464c7a7a4379bb7342ae73ac9cbd75ceb5fb8e9311b28dbdfd896b90b7e0fb068398ce9868e22b35f689611a1f24079d
7
+ data.tar.gz: 74f423605ce4dbe496c839fa93fed03cf6ae7c49bbbe12fa655b7bfe187af1221d007263819f9cce0cb1f222ee15c37787aff2492a3737bab281b9dff87ac23f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.93)
4
+ opswalrus (1.0.95)
5
5
  activesupport (~> 7.0)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  binding_of_caller (~> 1.0)
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 = 200)
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: 200)
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: 200) do |interaction_handler|
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: 200, &block)
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,
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.93"
2
+ VERSION = "1.0.95"
3
3
  end
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.93
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-13 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport