terraspace 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/terraspace/hooks/runner.rb +25 -2
- data/lib/terraspace/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: 790cbc55c399a3130eaaaa9e1e3af636a2b182cb28c2ca008e14a48d75883e47
|
4
|
+
data.tar.gz: 72d05ffb527f163d2b3be47542b77764ddbc599858e6dde6381058e992bc531c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a598f6c5e693d42c113a5aac0f4d2e63c41821a2414095ed65415fa6b11ab1636ce48d6a98ada24557c6b685642f1ac420fc9850544bd1cbda80e3de91036d48
|
7
|
+
data.tar.gz: f0a0955bbc1f7846e855141514a69b0aaffc81283081a5a90384fb85e4ec7946a65f19fa1dc3ff5df0e7c9f656ac5563fecca2c8a1a1959c83fa29d9daeae4bd
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [0.6.7] - 2021-05-05
|
7
|
+
- [#108](https://github.com/boltops-tools/terraspace/pull/108) provide runner context to terraspace hook
|
8
|
+
|
6
9
|
## [0.6.6] - 2021-04-15
|
7
10
|
- [#101](https://github.com/boltops-tools/terraspace/pull/101) terraspace force-unlock command
|
8
11
|
- [#102](https://github.com/boltops-tools/terraspace/pull/102) fix terraspace all summarized logging
|
@@ -2,6 +2,17 @@ module Terraspace::Hooks
|
|
2
2
|
class Runner
|
3
3
|
include Terraspace::Util
|
4
4
|
|
5
|
+
# exposing mod and hook so terraspace hooks have access to them via runner context. IE:
|
6
|
+
#
|
7
|
+
# class EnvExporter
|
8
|
+
# def call(runner)
|
9
|
+
# puts "runner.hook #{runner.hook}"
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# Docs: http://terraspace.cloud/docs/config/hooks/ruby/#method-argument
|
14
|
+
#
|
15
|
+
attr_reader :mod, :hook
|
5
16
|
def initialize(mod, hook)
|
6
17
|
@mod, @hook = mod, hook
|
7
18
|
@execute = @hook["execute"]
|
@@ -12,12 +23,24 @@ module Terraspace::Hooks
|
|
12
23
|
when String
|
13
24
|
Terraspace::Shell.new(@mod, @execute, exit_on_fail: @hook["exit_on_fail"]).run
|
14
25
|
when -> (e) { e.respond_to?(:public_instance_methods) && e.public_instance_methods.include?(:call) }
|
15
|
-
@execute.new
|
26
|
+
executor = @execute.new
|
16
27
|
when -> (e) { e.respond_to?(:call) }
|
17
|
-
@execute
|
28
|
+
executor = @execute
|
18
29
|
else
|
19
30
|
logger.warn "WARN: execute option not set for hook: #{@hook.inspect}"
|
20
31
|
end
|
32
|
+
|
33
|
+
if executor
|
34
|
+
meth = executor.method(:call)
|
35
|
+
case meth.arity
|
36
|
+
when 0
|
37
|
+
executor.call # backwards compatibility
|
38
|
+
when 1
|
39
|
+
executor.call(self)
|
40
|
+
else
|
41
|
+
raise "The #{executor} call method definition has been more than 1 arguments and is not supported"
|
42
|
+
end
|
43
|
+
end
|
21
44
|
end
|
22
45
|
end
|
23
46
|
end
|
data/lib/terraspace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terraspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|