steplib 0.9.0.3 → 0.9.0.4
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/lib/steplib/workflow_updater.rb +41 -21
- 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: 04dc0c48eee3e907fd062848412a925a9fcd0233
|
4
|
+
data.tar.gz: 5a5511cb083d6feb3bde08c4e8e87c602d2e658d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baf1579589f42f85c282e9d91891b8c0748f989da70a6d00acab923da7edbbb0909f237403f951e0e921022edde2a46a3de2ff12decee8fdc0c1f8c742b9486a
|
7
|
+
data.tar.gz: 51ba060c848921e7deb3487a5559e4d5aae3cac6c5dae0eba41394592ffc987f559a83a83a8d47ab2ad1eea0a2b4ab134a13cfff8edb16b5f505f5cff8c72689
|
@@ -8,41 +8,61 @@ module Steplib
|
|
8
8
|
#
|
9
9
|
# of course this can only fill-out properties
|
10
10
|
# which have a pre-defined valid default value
|
11
|
-
def
|
11
|
+
def set_defaults_for_missing_properties_in_workflow(workflow_data)
|
12
|
+
workflow_data = HashUtils.set_missing_defaults(workflow_data, [
|
13
|
+
# main arrays
|
14
|
+
{key: 'environments', value: []},
|
15
|
+
{key: 'steps', value: []},
|
16
|
+
])
|
17
|
+
#
|
18
|
+
# environments
|
12
19
|
workflow_data['environments'] = workflow_data['environments'].map { |an_env|
|
13
20
|
an_env = HashUtils.set_missing_defaults(an_env, [
|
14
21
|
{key: 'title', value: ''},
|
15
|
-
{key: 'is_expand', value: true}
|
22
|
+
{key: 'is_expand', value: true},
|
16
23
|
])
|
17
24
|
# return:
|
18
25
|
an_env
|
19
26
|
}
|
27
|
+
#
|
28
|
+
# steps
|
20
29
|
workflow_data['steps'] = workflow_data['steps'].map { |a_step|
|
21
|
-
a_step =
|
22
|
-
{key: 'name', value: ''},
|
23
|
-
{key: 'description', value: ''},
|
24
|
-
{key: 'icon_url_256', value: nil},
|
25
|
-
{key: 'project_type_tags', value: []},
|
26
|
-
{key: 'type_tags', value: []},
|
27
|
-
])
|
28
|
-
a_step['inputs'] = a_step['inputs'].map { |a_step_inp|
|
29
|
-
a_step_inp = HashUtils.set_missing_defaults(a_step_inp, [
|
30
|
-
{key: 'title', value: ''},
|
31
|
-
{key: 'description', value: ''},
|
32
|
-
{key: 'is_expand', value: true},
|
33
|
-
{key: 'is_required', value: false},
|
34
|
-
{key: 'value_options', value: []},
|
35
|
-
{key: 'is_dont_change_value', value: false},
|
36
|
-
])
|
37
|
-
# return:
|
38
|
-
a_step_inp
|
39
|
-
}
|
30
|
+
a_step = set_defaults_for_missing_properties_in_workflow_step(a_step)
|
40
31
|
# return:
|
41
32
|
a_step
|
42
33
|
}
|
43
34
|
return workflow_data
|
44
35
|
end
|
45
36
|
|
37
|
+
#
|
38
|
+
# similar to \a set_defaults_for_missing_properties_in_workflow
|
39
|
+
# but for a single workflow-step
|
40
|
+
def set_defaults_for_missing_properties_in_workflow_step(workflow_step_data)
|
41
|
+
workflow_step_data = HashUtils.set_missing_defaults(workflow_step_data, [
|
42
|
+
{key: 'name', value: ''},
|
43
|
+
{key: 'description', value: ''},
|
44
|
+
{key: 'icon_url_256', value: nil},
|
45
|
+
{key: 'project_type_tags', value: []},
|
46
|
+
{key: 'type_tags', value: []},
|
47
|
+
# main arrays
|
48
|
+
{key: 'inputs', value: []},
|
49
|
+
{key: 'outputs', value: []},
|
50
|
+
])
|
51
|
+
workflow_step_data['inputs'] = workflow_step_data['inputs'].map { |a_step_inp|
|
52
|
+
a_step_inp = HashUtils.set_missing_defaults(a_step_inp, [
|
53
|
+
{key: 'title', value: ''},
|
54
|
+
{key: 'description', value: ''},
|
55
|
+
{key: 'is_expand', value: true},
|
56
|
+
{key: 'is_required', value: false},
|
57
|
+
{key: 'value_options', value: []},
|
58
|
+
{key: 'is_dont_change_value', value: false},
|
59
|
+
])
|
60
|
+
# return:
|
61
|
+
a_step_inp
|
62
|
+
}
|
63
|
+
return workflow_step_data
|
64
|
+
end
|
65
|
+
|
46
66
|
#
|
47
67
|
# The input steplib_step_version have to be a valid step-version!
|
48
68
|
# The input workflow_step is not copied, modified in-inline!
|