opswalrus 1.0.2 → 1.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf572dd5c13457782bb8256a38f4572ba897a7bb37ab4da0220fd3a69866b8ad
4
- data.tar.gz: 6ebc7681b98c3bc745b310eee40f866b8d6d328c37b50552b409ca1362b07889
3
+ metadata.gz: b31832ac2c06fb96c6abac86dacccce0f4fa280d679f2f12573eb37044d49b93
4
+ data.tar.gz: dc69618f8f83b0845f5e93a8e4699bcade24e37a3ce24fcecc49a427f2b471ff
5
5
  SHA512:
6
- metadata.gz: 2be383a35f09b51d6e42be8280eaf3760d8735aea0b747406e9258b237dc38b55594a56000a88d2a1c398ae7de56d1391903eed0d1c542850f9bd4f167348c9c
7
- data.tar.gz: 71f1f58d4dda0533fdbd8fd35612daae8f2ad8390ae215d2d437432b6ab801c9ed87f614eb54c018db3ccbe72806625f38471d16b7edbff72ddfed376530437b
6
+ metadata.gz: c107c7165daa8536b4831c7f84d34c662dcc86cad1da29334412460e2995adad5bb076f14ae48b90578e2c349ea55411e4f2794371d417e714bffb093dca4f3b
7
+ data.tar.gz: d6e0983ef2d59ed545370dd670753436026244b0cc5c84dadb3745b188931839f5edd57425f65fa4a607324b4d1e17bd4e0431bb5bb2cbb825e8a95e1f9eca6c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.1)
4
+ opswalrus (1.0.3)
5
5
  bcrypt_pbkdf
6
6
  citrus
7
7
  ed25519
data/lib/opswalrus/cli.rb CHANGED
@@ -15,10 +15,10 @@ module OpsWalrus
15
15
 
16
16
  # this is invoked on an unhandled exception or a call to exit_now!
17
17
  on_error do |exception|
18
- puts "*" * 80
19
- puts "catchall exception handler:"
20
- puts exception.message
21
- puts exception.backtrace.join("\n")
18
+ # puts "*" * 80
19
+ # puts "catchall exception handler:"
20
+ # puts exception.message
21
+ # puts exception.backtrace.join("\n")
22
22
  false # disable built-in exception handling
23
23
  end
24
24
 
@@ -132,6 +132,7 @@ module OpsWalrus
132
132
 
133
133
  c.default_command :status
134
134
  end
135
+
135
136
  end
136
137
  end
137
138
 
@@ -54,13 +54,17 @@ module OpsWalrus
54
54
  # end
55
55
 
56
56
  # runs the specified ops command with the specified command arguments
57
- def run_ops(command, command_arguments, in_bundle_root_dir: true)
58
- if in_bundle_root_dir
59
- # e.g. /home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops bundle unzip tmpops.zip
60
- shell!("/home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops #{command} #{@tmp_bundle_root_dir} #{command_arguments}")
61
- else
62
- shell!("/home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops #{command} #{command_arguments}")
63
- end
57
+ def run_ops(command, command_arguments, in_bundle_root_dir: true, verbose: false)
58
+ # e.g. /home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops bundle unzip tmpops.zip
59
+ # e.g. /home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops run echo.ops args:foo args:bar
60
+
61
+ cmd = "/home/linuxbrew/.linuxbrew/bin/gem exec -g opswalrus ops"
62
+ cmd << " -v" if verbose
63
+ cmd << " #{command.to_s}"
64
+ cmd << " #{@tmp_bundle_root_dir}" if in_bundle_root_dir
65
+ cmd << " #{command_arguments}" unless command_arguments.empty?
66
+
67
+ shell!(cmd)
64
68
  end
65
69
 
66
70
  end
@@ -27,6 +27,10 @@ module OpsWalrus
27
27
  @yaml || (load_file && @yaml)
28
28
  end
29
29
 
30
+ def script_line_offset
31
+ @script_line_offset || (load_file && @script_line_offset)
32
+ end
33
+
30
34
  def script
31
35
  @script || (load_file && @script)
32
36
  end
@@ -35,6 +39,7 @@ module OpsWalrus
35
39
  yaml, ruby_script = if @ops_file_path.exist?
36
40
  parse(File.read(@ops_file_path))
37
41
  end || ["", ""]
42
+ @script_line_offset = yaml.lines.size + 1 # +1 to account for the ... line
38
43
  @yaml = YAML.load(yaml) || {} # post_invariant: @yaml is a Hash
39
44
  @script = OpsFileScript.new(self, ruby_script)
40
45
  end
@@ -475,7 +475,7 @@ module OpsWalrus
475
475
 
476
476
  def evaluate
477
477
  # catch(:exit_now) do
478
- eval(@ops_file_script.script)
478
+ eval(@ops_file_script.script, nil, @ops_file_script.ops_file.ops_file_path.to_s, @ops_file_script.ops_file.script_line_offset)
479
479
  # end
480
480
  end
481
481
 
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
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.2
4
+ version: 1.0.3
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-08-15 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus