henry-container 0.1.45 → 0.1.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/henry/config.rb +10 -1
- data/lib/henry/container/version.rb +1 -1
- data/lib/henry/input.rb +14 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 818704fd2d6c4635eb865c01e2e61be880c04aee
|
4
|
+
data.tar.gz: dd41f95783269992028b9123ba84a2689bdd655a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f2fd61d71666a0e966a236a1f786db359c862d9951a89fdd52bb1391544bf519b6e7fa36f1b0af846bb4ab043d0ff4c4231839f5c40b071d7e4cdfcc898dda
|
7
|
+
data.tar.gz: 368d3edd6d63cdce284bc9cd21ee680ff311038d782acda8c220633972719598041228d2bd4977e87a924052f9b0e100d96329d28937c8c00d2ccb6a15fe043c
|
data/lib/henry/config.rb
CHANGED
@@ -5,7 +5,16 @@ module Henry
|
|
5
5
|
class Config < Henry::Input
|
6
6
|
|
7
7
|
# ENV key where the Config will be exported to/imported from.
|
8
|
-
|
8
|
+
#
|
9
|
+
# @return [String] the env config key.
|
10
|
+
EXPORT_KEY = 'HENRY_CONFIG'
|
11
|
+
|
12
|
+
# ENV key where the Config will be exported to/imported from.
|
13
|
+
#
|
14
|
+
# @return [String] the env config key.
|
15
|
+
def self.export_key
|
16
|
+
Henry::Config::EXPORT_KEY
|
17
|
+
end
|
9
18
|
|
10
19
|
end
|
11
20
|
|
data/lib/henry/input.rb
CHANGED
@@ -4,8 +4,17 @@ module Henry
|
|
4
4
|
class Input
|
5
5
|
attr_reader :params
|
6
6
|
|
7
|
-
# ENV key where the
|
8
|
-
|
7
|
+
# ENV key where the Config will be exported to/imported from.
|
8
|
+
#
|
9
|
+
# @return [String] the env config key.
|
10
|
+
EXPORT_KEY = 'HENRY_INPUT'
|
11
|
+
|
12
|
+
# ENV key where the Config will be exported to/imported from.
|
13
|
+
#
|
14
|
+
# @return [String] the env config key.
|
15
|
+
def self.export_key
|
16
|
+
Henry::Input::EXPORT_KEY
|
17
|
+
end
|
9
18
|
|
10
19
|
# Initialize the Input with the given params or empty.
|
11
20
|
#
|
@@ -26,7 +35,7 @@ module Henry
|
|
26
35
|
#
|
27
36
|
# @return [Input]
|
28
37
|
def export!
|
29
|
-
ENV[
|
38
|
+
ENV[self.export_key] = JSON.dump(@params)
|
30
39
|
self
|
31
40
|
end
|
32
41
|
|
@@ -41,8 +50,8 @@ module Henry
|
|
41
50
|
#
|
42
51
|
# @return [Input]
|
43
52
|
def import!
|
44
|
-
if ENV[
|
45
|
-
@params = JSON.parse(ENV[
|
53
|
+
if ENV[self.export_key]
|
54
|
+
@params = JSON.parse(ENV[self.export_key])
|
46
55
|
else
|
47
56
|
warn("Could not load the execution params.\nAre you running this Task via the henry-ruby-container? You should!".red)
|
48
57
|
end
|