steplib 0.9.0.5 → 0.9.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66e4f21e8f660fc8d451a6827b4f37cc6521dcdb
4
- data.tar.gz: a71aba9ebcb1794b4b8cf6b4fc2118e23bdc78a4
3
+ metadata.gz: ac2ab879cd2d14f65be39f5e31dfb1a9f50c83eb
4
+ data.tar.gz: 550f989699a6e3575479ed61ce32a8e0fb692340
5
5
  SHA512:
6
- metadata.gz: 8c80e7a566e9f6436518e9d83a2f6a3ee0a7cf3e502452f73ef2da3788e45335c636c97b179188ec1d02b00ce9346b8d6990606cc803f37fb1d487c56bb33bf1
7
- data.tar.gz: 9c2712aa277c6ea674ef8f8be3484d73f763e5ea5c674d0a837666a3ba28dd4472b3e47e2bd4a07c8e5acfdcea9693d88b42fad14bcbc888270a47361fda3373
6
+ metadata.gz: ecb3c5e44bde0e8124d1e55d3e6e0a5199310e6c92afd6492d3903947aa26c208127c773be7aded7aec2d428286e7e8aa85b2c7f8873af026baf100d38fe5651
7
+ data.tar.gz: b0bfb6e6419be8939f9e77761705b865443ab1125ceb1278e33c55c82510c7e59a7f61348361a456e33123d648c8ec051eb10e2a9fe172f5f3b23d260d5c9c5c
@@ -0,0 +1,47 @@
1
+ require_relative 'hash_utils'
2
+
3
+ module Steplib
4
+ class SteplibUpdater
5
+ class << self
6
+
7
+ #
8
+ # of course this can only fill-out properties
9
+ # which have a pre-defined valid default value
10
+ def set_defaults_for_missing_properties_in_step_version(step_version_data)
11
+ step_version_data = HashUtils.set_missing_defaults(step_version_data, [
12
+ {key: 'fork_url', value: step_version_data['website']},
13
+ {key: 'icon_url_256', value: nil},
14
+ {key: 'project_type_tags', value: []},
15
+ {key: 'type_tags', value: []},
16
+ {key: 'inputs', value: []},
17
+ {key: 'outputs', value: []},
18
+ ])
19
+ #
20
+ # inputs
21
+ step_version_data['inputs'] = step_version_data['inputs'].map { |a_step_inp|
22
+ a_step_inp = HashUtils.set_missing_defaults(a_step_inp, [
23
+ {key: 'description', value: ''},
24
+ {key: 'is_expand', value: true},
25
+ {key: 'is_required', value: false},
26
+ {key: 'value_options', value: []},
27
+ {key: 'value', value: ''},
28
+ {key: 'is_dont_change_value', value: false},
29
+ ])
30
+ # return:
31
+ a_step_inp
32
+ }
33
+ #
34
+ # outputs
35
+ step_version_data['outputs'] = step_version_data['outputs'].map { |a_step_output|
36
+ a_step_output = HashUtils.set_missing_defaults(a_step_output, [
37
+ {key: 'description', value: ''}
38
+ ])
39
+ # return:
40
+ a_step_output
41
+ }
42
+ return step_version_data
43
+ end
44
+
45
+ end
46
+ end
47
+ end
@@ -60,6 +60,13 @@ module Steplib
60
60
  # return:
61
61
  a_step_inp
62
62
  }
63
+ workflow_step_data['outputs'] = workflow_step_data['outputs'].map { |a_step_output|
64
+ a_step_output = HashUtils.set_missing_defaults(a_step_output, [
65
+ {key: 'description', value: ''}
66
+ ])
67
+ # return:
68
+ a_step_output
69
+ }
63
70
  return workflow_step_data
64
71
  end
65
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steplib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.5
4
+ version: 0.9.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bitrise
@@ -21,6 +21,7 @@ extra_rdoc_files: []
21
21
  files:
22
22
  - lib/steplib.rb
23
23
  - lib/steplib/hash_utils.rb
24
+ - lib/steplib/steplib_updater.rb
24
25
  - lib/steplib/steplib_validator.rb
25
26
  - lib/steplib/workflow_updater.rb
26
27
  - lib/steplib/workflow_utils.rb