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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opswalrus/cli.rb +5 -4
- data/lib/opswalrus/host.rb +11 -7
- data/lib/opswalrus/ops_file.rb +5 -0
- data/lib/opswalrus/ops_file_script.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: b31832ac2c06fb96c6abac86dacccce0f4fa280d679f2f12573eb37044d49b93
|
4
|
+
data.tar.gz: dc69618f8f83b0845f5e93a8e4699bcade24e37a3ce24fcecc49a427f2b471ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c107c7165daa8536b4831c7f84d34c662dcc86cad1da29334412460e2995adad5bb076f14ae48b90578e2c349ea55411e4f2794371d417e714bffb093dca4f3b
|
7
|
+
data.tar.gz: d6e0983ef2d59ed545370dd670753436026244b0cc5c84dadb3745b188931839f5edd57425f65fa4a607324b4d1e17bd4e0431bb5bb2cbb825e8a95e1f9eca6c
|
data/Gemfile.lock
CHANGED
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
|
|
data/lib/opswalrus/host.rb
CHANGED
@@ -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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
data/lib/opswalrus/ops_file.rb
CHANGED
@@ -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
|
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.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-
|
11
|
+
date: 2023-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: citrus
|