steplib 0.9.0.4 → 0.9.0.5
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/hash_utils.rb +3 -3
- data/lib/steplib/workflow_updater.rb +26 -11
- 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: 66e4f21e8f660fc8d451a6827b4f37cc6521dcdb
|
4
|
+
data.tar.gz: a71aba9ebcb1794b4b8cf6b4fc2118e23bdc78a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c80e7a566e9f6436518e9d83a2f6a3ee0a7cf3e502452f73ef2da3788e45335c636c97b179188ec1d02b00ce9346b8d6990606cc803f37fb1d487c56bb33bf1
|
7
|
+
data.tar.gz: 9c2712aa277c6ea674ef8f8be3484d73f763e5ea5c674d0a837666a3ba28dd4472b3e47e2bd4a07c8e5acfdcea9693d88b42fad14bcbc888270a47361fda3373
|
data/lib/steplib/hash_utils.rb
CHANGED
@@ -58,7 +58,7 @@ module Steplib
|
|
58
58
|
# from copy_to hash.
|
59
59
|
# Doesn't do a copy of input hash, will inline-set
|
60
60
|
# the attributes / modify the input hash!
|
61
|
-
def
|
61
|
+
def copy_missing_attributes(hsh_copy_to, hsh_copy_from, attr_to_copy_list)
|
62
62
|
attr_to_copy_list.each do |a_attr_to_copy|
|
63
63
|
if hsh_copy_to[a_attr_to_copy].nil?
|
64
64
|
hsh_copy_to[a_attr_to_copy] = hsh_copy_from[a_attr_to_copy]
|
@@ -68,9 +68,9 @@ module Steplib
|
|
68
68
|
end
|
69
69
|
# Deep-copy version
|
70
70
|
# Returns a new hash, the original input hash will be kept unchanged!
|
71
|
-
def
|
71
|
+
def copy_missing_attributes_dcopy(in_hsh_copy_to, hsh_copy_from, attr_to_copy_list)
|
72
72
|
hsh_copy_to = deep_copy(in_hsh_copy_to)
|
73
|
-
return
|
73
|
+
return copy_missing_attributes(hsh_copy_to, hsh_copy_from, attr_to_copy_list)
|
74
74
|
end
|
75
75
|
|
76
76
|
#
|
@@ -82,26 +82,31 @@ module Steplib
|
|
82
82
|
raise "Workflow-step 'version_tag' doesn't match the steplib-step-version's"
|
83
83
|
end
|
84
84
|
#
|
85
|
-
# copy all except:
|
86
|
-
# *
|
85
|
+
# copy all except the ones which are used for identifying the input inside a step(-version):
|
86
|
+
# * steplib_source
|
87
|
+
# * id
|
87
88
|
# * version_tag
|
89
|
+
#
|
90
|
+
# copy no-matter-what:
|
88
91
|
workflow_step = HashUtils.copy_attributes(
|
89
92
|
workflow_step,
|
90
93
|
steplib_step_version,
|
91
|
-
[
|
92
|
-
'id', 'steplib_source', 'description',
|
93
|
-
'website', 'fork_url', 'source', 'host_os_tags',
|
94
|
+
['description', 'website', 'fork_url', 'source', 'host_os_tags',
|
94
95
|
'project_type_tags', 'type_tags', 'is_requires_admin_user',
|
95
|
-
'icon_url_256'
|
96
|
-
|
96
|
+
'icon_url_256']
|
97
|
+
)
|
98
|
+
#
|
99
|
+
# copy only if missing
|
100
|
+
# see "@WorkflowUserMod" in the steplib format spec for more information
|
101
|
+
workflow_step = HashUtils.copy_missing_attributes(
|
102
|
+
workflow_step,
|
103
|
+
steplib_step_version,
|
104
|
+
['name']
|
97
105
|
)
|
98
106
|
|
99
107
|
# update inputs and remove the ones which can't be
|
100
108
|
# found in the steplib step version's inputs
|
101
109
|
# and add the missing ones
|
102
|
-
# update except:
|
103
|
-
# * mapped_to
|
104
|
-
# * value
|
105
110
|
steplib_step_version_inputs = steplib_step_version['inputs']
|
106
111
|
workflow_step['inputs'] = workflow_step['inputs'].map { |a_wf_step_inp|
|
107
112
|
# search for the same input in the steplib-step-version
|
@@ -117,12 +122,22 @@ module Steplib
|
|
117
122
|
# return:
|
118
123
|
nil
|
119
124
|
else
|
125
|
+
# copy all except the ones which are used for identifying the input inside a step(-version):
|
126
|
+
# * mapped_to
|
127
|
+
# copy no matter what
|
120
128
|
a_wf_step_inp = HashUtils.copy_attributes(
|
121
129
|
a_wf_step_inp,
|
122
130
|
related_steplib_input,
|
123
|
-
['title', 'description',
|
131
|
+
['title', 'description',
|
124
132
|
'is_required', 'value_options', 'is_dont_change_value']
|
125
133
|
)
|
134
|
+
# copy only if missing
|
135
|
+
# see "@WorkflowUserMod" in the steplib format spec for more information
|
136
|
+
a_wf_step_inp = HashUtils.copy_missing_attributes(
|
137
|
+
a_wf_step_inp,
|
138
|
+
related_steplib_input,
|
139
|
+
['value', 'is_expand']
|
140
|
+
)
|
126
141
|
# return:
|
127
142
|
a_wf_step_inp
|
128
143
|
end
|