roku_builder 4.9.2 → 4.9.3

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: bc0f25a2308dd590a02ad47120860ed27d2034ec
4
- data.tar.gz: 156f82b7949d6ab909a8958ad27406d863c1c746
3
+ metadata.gz: 36d7f8916f1accf419e300cf40cc9d7764c0f86f
4
+ data.tar.gz: 2fb64f3f10a5f731115bc8bd0d7b40777c99abc7
5
5
  SHA512:
6
- metadata.gz: c08044d6035efaef54ea9c8ecb36515db3b63d57e36be385c38a839467c6230df903ece8884e0b2709c8bbfe57480481f2f7108aeb000d2cf729a4328ca58a3c
7
- data.tar.gz: f1da45a41abdf6ee9b8acec4eab8080ba9bebc0e1b48d657dbebe827aff3de9f0473b1ee927eb1e0a34419ef77a7f275652e3c7ed0bbce8931acc322635dec00
6
+ metadata.gz: 2aabf35295f5317f61d74384ade158e1f7d4cf22047e285014ae24c68e2c850722bd6016067fa0876e6c6f121f08b0ef1a836af57e418f69460aec8bc05ec3f3
7
+ data.tar.gz: 58a14f12786f9e49cba4bd54c9283d96f371af444e32a3e549e59286e11568fe00ee72b2a2c4e0ad8555a8ed62647a54c5cb0268f921e66bee361aa388dc321e
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ = 4.9.3 =
2
+
3
+ - Fix crash on invlaid config
4
+ - Prevent loading incompatable file types
5
+ - Update Analyzer results for API access
6
+
1
7
  = 4.9.2 =
2
8
 
3
9
  - Cosmetic fixes
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roku_builder (4.9.2)
4
+ roku_builder (4.9.3)
5
5
  faraday (~> 0.13)
6
6
  faraday-digestauth (~> 0.2)
7
7
  git (~> 1.3)
@@ -182,7 +182,7 @@ module RokuBuilder
182
182
  end
183
183
 
184
184
  def fix_config_symbol_values
185
- if @config[:devices]
185
+ if @config[:devices] and @config[:devices][:default]
186
186
  @config[:devices][:default] = @config[:devices][:default].to_sym
187
187
  end
188
188
  if @config[:projects]
@@ -192,7 +192,9 @@ module RokuBuilder
192
192
  end
193
193
 
194
194
  def fix_project_config_symbol_values
195
- @config[:projects][:default] = @config[:projects][:default].to_sym
195
+ if @config[:projects] [:default]
196
+ @config[:projects][:default] = @config[:projects][:default].to_sym
197
+ end
196
198
  @config[:projects].each_pair do |key,value|
197
199
  next if is_skippable_project_key? key
198
200
  if value[:stage_method]
@@ -65,7 +65,8 @@ module RokuBuilder
65
65
  add_warning(warning: :packageSourceDirectory, path: "source")
66
66
  end
67
67
  @warnings.concat(raf_inspector.run(analyzer_config[:inspectors]))
68
- print_warnings(dir) unless quiet
68
+ format_messages(dir)
69
+ print_warnings unless quiet
69
70
  end
70
71
  @warnings
71
72
  end
@@ -86,20 +87,15 @@ module RokuBuilder
86
87
  @warnings.last[:path] = path
87
88
  end
88
89
 
89
- def print_warnings(dir)
90
+ def print_warnings
90
91
  logger = ::Logger.new(STDOUT)
91
92
  logger.level = @logger.level
92
93
  logger.formatter = proc {|severity, _datetime, _progname, msg|
93
94
  "%5s: %s\n\r" % [severity, msg]
94
95
  }
96
+ @logger.unknown "====== Analysis Results ======"
95
97
  @warnings.each do |warning|
96
98
  message = warning[:message]
97
- if warning[:path]
98
- warning[:path].slice!(dir) if dir
99
- warning[:path].slice!(/^\//)
100
- message += ". pkg:/"+warning[:path]
101
- message += ":"+(warning[:line]+1).to_s if warning[:line]
102
- end
103
99
  case(warning[:severity])
104
100
  when "error"
105
101
  logger.error(message)
@@ -110,6 +106,17 @@ module RokuBuilder
110
106
  end
111
107
  end
112
108
  end
109
+
110
+ def format_messages(dir)
111
+ @warnings.each do |warning|
112
+ if warning[:path]
113
+ warning[:path].slice!(dir) if dir
114
+ warning[:path].slice!(/^\//)
115
+ warning[:message] += ". pkg:/"+warning[:path]
116
+ warning[:message] += ":"+(warning[:line]+1).to_s if warning[:line]
117
+ end
118
+ end
119
+ end
113
120
  end
114
121
  RokuBuilder.register_plugin(Analyzer)
115
122
  end
@@ -154,7 +154,12 @@ module RokuBuilder
154
154
  else
155
155
  unless excludes.include?(zipFilePath)
156
156
  if File.exist?(diskFilePath)
157
- io.get_output_stream(zipFilePath) { |f| f.puts(File.open(diskFilePath, "rb").read()) }
157
+ # Deny filetypes that aren't compatible with Roku to avoid Certification issues.
158
+ if !zipFilePath.end_with?(".pkg", ".md", ".zip")
159
+ io.get_output_stream(zipFilePath) { |f| f.puts(File.open(diskFilePath, "rb").read()) }
160
+ else
161
+ @logger.warn "Ignored file with invalid Roku filetype " + File.basename(diskFilePath)
162
+ end
158
163
  else
159
164
  @logger.warn "Missing File: #{diskFilePath}"
160
165
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.9.2"
5
+ VERSION = "4.9.3"
6
6
  end
@@ -316,7 +316,7 @@ module RokuBuilder
316
316
  def test_performance_aa_string_ref
317
317
  warnings = test_file(text: "aa[\"test\"] = \"test\"")
318
318
  assert_equal 1, warnings.count
319
- assert_match(/String referance/, warnings[0][:message])
319
+ assert_match(/String reference/, warnings[0][:message])
320
320
  end
321
321
  def test_performance_for_loop
322
322
  warnings = test_file(text: "FOR i=0 TO 10\n ? i\nEND FOR")
@@ -298,5 +298,15 @@ module RokuBuilder
298
298
  refute_nil config.input_mappings
299
299
  assert_equal ["home", "Home"], config.input_mappings[:a]
300
300
  end
301
+ def test_config_no_default_device
302
+ options = build_options({config: File.join(test_files_path(ConfigTest), "no_default_project.json"), validate: true})
303
+ config = Config.new(options: options)
304
+ config.load
305
+ end
306
+ def test_config_no_default_project
307
+ options = build_options({config: File.join(test_files_path(ConfigTest), "no_default_device.json"), validate: true})
308
+ config = Config.new(options: options)
309
+ config.load
310
+ end
301
311
  end
302
312
  end
@@ -0,0 +1,31 @@
1
+ {
2
+ "devices": {
3
+ "roku": {
4
+ "ip": "111.222.333.444",
5
+ "user": "user",
6
+ "password": "pass"
7
+ }
8
+ },
9
+ "projects": {
10
+ "default": "p1",
11
+ "p1": {
12
+ "directory": "/tmp",
13
+ "folders": ["resources","source"],
14
+ "files": ["manifest"],
15
+ "app_name": "app",
16
+ "stage_method": "git",
17
+ "stages":{
18
+ "production": {
19
+ "branch": "master",
20
+ "key": {
21
+ "keyed_pkg": "/tmp/package.pkg",
22
+ "password": "password"
23
+ }
24
+ }
25
+ }
26
+ }
27
+ },
28
+ "input_mappings": {
29
+ "a": ["home", "Home"]
30
+ }
31
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "devices": {
3
+ "default": "roku",
4
+ "roku": {
5
+ "ip": "111.222.333.444",
6
+ "user": "user",
7
+ "password": "pass"
8
+ }
9
+ },
10
+ "projects": {
11
+ "p1": {
12
+ "directory": "/tmp",
13
+ "folders": ["resources","source"],
14
+ "files": ["manifest"],
15
+ "app_name": "app",
16
+ "stage_method": "git",
17
+ "stages":{
18
+ "production": {
19
+ "branch": "master",
20
+ "key": {
21
+ "keyed_pkg": "/tmp/package.pkg",
22
+ "password": "password"
23
+ }
24
+ }
25
+ }
26
+ }
27
+ },
28
+ "input_mappings": {
29
+ "a": ["home", "Home"]
30
+ }
31
+ }
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.9.2
4
+ version: 4.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-19 00:00:00.000000000 Z
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -554,6 +554,8 @@ files:
554
554
  - test/roku_builder/test_files/config_test/config.json
555
555
  - test/roku_builder/test_files/config_test/local.json
556
556
  - test/roku_builder/test_files/config_test/multi_repeat_stages.json
557
+ - test/roku_builder/test_files/config_test/no_default_device.json
558
+ - test/roku_builder/test_files/config_test/no_default_project.json
557
559
  - test/roku_builder/test_files/config_test/non_json.json
558
560
  - test/roku_builder/test_files/config_test/parent.json
559
561
  - test/roku_builder/test_files/config_test/parent_projects.json
@@ -677,6 +679,8 @@ test_files:
677
679
  - test/roku_builder/test_files/config_test/config.json
678
680
  - test/roku_builder/test_files/config_test/local.json
679
681
  - test/roku_builder/test_files/config_test/multi_repeat_stages.json
682
+ - test/roku_builder/test_files/config_test/no_default_device.json
683
+ - test/roku_builder/test_files/config_test/no_default_project.json
680
684
  - test/roku_builder/test_files/config_test/non_json.json
681
685
  - test/roku_builder/test_files/config_test/parent.json
682
686
  - test/roku_builder/test_files/config_test/parent_projects.json