roku_builder 4.23.0 → 4.23.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 373790650070231c745746cd44c6ad316f34746e27fd73a4849b2d02279df624
4
- data.tar.gz: de065657de7cf806f4db60a01230eef93d1f92aba581c5456752367e01554900
3
+ metadata.gz: 1d1ca3fbc26d92a86625530b1578517b2db8f0932f10a723e27e471a08d848da
4
+ data.tar.gz: 8c06399f94abd5dd482bce4111da7f647ca16497ab021ffc838c0387d924691c
5
5
  SHA512:
6
- metadata.gz: 16a02701b5eaed8f0f6dbee5edd0c42d3f26481139384aac9ecc545c96695259d0c4509274b3543cf5fd137c55f9ae19e27dda9f21a0813a725f6d1e0ae870ce
7
- data.tar.gz: 01fbc2cd1d4bf08f4ee2f8a8fed846300d0a6629b54cb6a45484af7b4ff0388dde3ebfc84ac7d940bed5697700c5be690bc7491c10fcc366a374c59a8caaf75f
6
+ metadata.gz: ebd9c0cddf2a18fd73f69c864152b2e78fa942bb1ffc63862f35ad767623b3d9e109c14aa0fca8b5f5a7511967732677bb6f885aec5db8908ab8ac56257228bd
7
+ data.tar.gz: a6e9341c1e88ed59b10a6c2aafc6c9cff8646509e0cc7fa6092b549724d8964a5a2d822a67561fd058853b8fd8d80a25bc5df2acd4ccdf1bb10c6053f4b9d110
@@ -169,10 +169,12 @@ module RokuBuilder
169
169
  end
170
170
 
171
171
  def setup_key_config
172
- if @parsed[:stage]
173
- @parsed[:key] = @parsed[:stage][:key]
174
- get_global_key_config if @parsed[:key].class == String
175
- test_key_file
172
+ if @options.keyed_command?
173
+ if @parsed[:stage]
174
+ @parsed[:key] = @parsed[:stage][:key]
175
+ get_global_key_config if @parsed[:key].class == String
176
+ test_key_file
177
+ end
176
178
  end
177
179
  end
178
180
 
@@ -26,7 +26,7 @@ module RokuBuilder
26
26
  KEY_MISSING_PATH = 19
27
27
  KEY_MISSING_PASSWORD = 20
28
28
  INVALID_MAPPING_INFO = 21
29
- MISSING_KEY = 22
29
+ # = 22
30
30
  MISSING_STAGE_METHOD = 23
31
31
 
32
32
  def initialize(config:)
@@ -153,7 +153,6 @@ module RokuBuilder
153
153
  errors= [
154
154
  [STAGE_MISSING_BRANCH, (!stage[:branch] and project[:stage_method] == :git)],
155
155
  [STAGE_MISSING_SCRIPT, (!stage[:script] and project[:stage_method] == :script)],
156
- [MISSING_KEY, (!!stage[:key] and stage[:key].class == String and (!@config[:keys] or !@config[:keys][stage[:key].to_sym]))]
157
156
  ]
158
157
  process_errors(errors: errors)
159
158
  end
@@ -31,6 +31,10 @@ module RokuBuilder
31
31
  device_commands.include?(command)
32
32
  end
33
33
 
34
+ def keyed_command?
35
+ keyed_commands.include?(command)
36
+ end
37
+
34
38
  def has_source?
35
39
  !(keys & sources).empty?
36
40
  end
@@ -41,7 +45,7 @@ module RokuBuilder
41
45
  RokuBuilder.plugins.each do |plugin|
42
46
  plugin.commands.each do |command, attributes|
43
47
  commands << command
44
- [:device, :source, :exclude].each do |type|
48
+ [:device, :source, :exclude, :keyed].each do |type|
45
49
  if attributes[type]
46
50
  send("#{type}_commands".to_sym) << command
47
51
  end
@@ -148,5 +152,11 @@ module RokuBuilder
148
152
  def device_commands
149
153
  @device_commands ||= []
150
154
  end
155
+
156
+ # List of commands that require a key
157
+ # @return [Array<Symbol>] List of commands that require a key
158
+ def keyed_commands
159
+ @keyed_commands ||= []
160
+ end
151
161
  end
152
162
  end
@@ -8,7 +8,7 @@ module RokuBuilder
8
8
  def self.commands
9
9
  {
10
10
  configure: {},
11
- validate: {},
11
+ validate: {keyed: true},
12
12
  increment: {source: true, stage: true},
13
13
  dostage: {source: true},
14
14
  dounstage: {source: true}
@@ -50,7 +50,7 @@ module RokuBuilder
50
50
  elsif @prev_line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
51
51
  @ind += @count
52
52
  elsif @prev_line =~ /^\s*#?if\b|^\s*#?else\b/i
53
- unless @prev_line =~ /\bthen\b[ \t ]*[^' \r\n']+.*$/i or @prev_line =~ /\breturn\b/i
53
+ unless @prev_line =~ /\bthen\b[ \t]*[^' \r\n]+.*$/i or @prev_line =~ /\breturn\b/i
54
54
  @ind += @count
55
55
  end
56
56
  elsif @prev_line =~ /^\s*\bfor\b|^\s*\bwhile\b/i
@@ -7,9 +7,9 @@ module RokuBuilder
7
7
 
8
8
  def self.commands
9
9
  {
10
- package: {device: true, source: true, stage: true, exclude: true},
10
+ package: {device: true, source: true, stage: true, exclude: true, keyed: true},
11
11
  genkey: {device: true},
12
- key: {device: true, source: true}
12
+ key: {device: true, source: true, keyed: true}
13
13
  }
14
14
  end
15
15
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.23.0"
5
+ VERSION = "4.23.1"
6
6
  end
@@ -167,13 +167,6 @@ module RokuBuilder
167
167
  assert_equal [15, -1], validator.instance_variable_get(:@codes)
168
168
  end
169
169
 
170
- def test_config_manager_validate_project_key
171
- config = good_config
172
- config[:projects][:project2][:stages][:production][:key] = "b"
173
- validator = ConfigValidator.new(config: config)
174
- assert_equal [22], validator.instance_variable_get(:@codes)
175
- end
176
-
177
170
  def test_config_manager_validate_keys_pkg
178
171
  config = good_config
179
172
  config[:keys][:a][:keyed_pkg] = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roku_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.23.0
4
+ version: 4.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-23 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip