roku_builder 4.21.1 → 4.21.6

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: 14e0e8c8c442ff787f466072df4d0ada2940af2211b912fc34483de1a4240dd2
4
- data.tar.gz: 3a080babe3d406b62aace4a74ae296f017f46ce43e9eb39d33c8ccaf0fdb16e1
3
+ metadata.gz: bcd83884e0acc2164d90915b4949c8a8b8334ee072ed45ca3c82e1f823b77d3f
4
+ data.tar.gz: 8f48403dd9bba7982c0cde10a2667f85d3da88244401fa17fd4b1d8675cb4709
5
5
  SHA512:
6
- metadata.gz: ec5169d5a364464d2c5497af55220501d467625fd89e0bd87af25db03d00ff3c61f6571782ea6267089218e5f57404a33df63fb2bb49d5b8538ee95a24d79c16
7
- data.tar.gz: 7a99072769cf9433d2223b88ed4443ce0be2018a90b5b8c4e38ca37ef93629f926551c00ce99408caf7e014e8fff45c2d08de3df838a1a0e4c58bbdc06914883
6
+ metadata.gz: e5397243a045a1d8bac3dbc06381513e7a34b5e74bdb00d7e8cfd2eaf4bb89f520e8b01c1c25bae531551d1cce2a1273dec0b7d84f5877b2b61741e54e59f1a8
7
+ data.tar.gz: d368e046903392039969c8a3ba0b339755fd6a707126f792403143c8b2d835dfa4156f8464d19bf733e6ff76241ccf4b1efe695a85bd745f2126bfa1abf54af5
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.4.1"
3
+ - "2.6.0"
4
4
  before_install:
5
5
  - gem install bundler
data/CHANGELOG CHANGED
@@ -1,6 +1,18 @@
1
- = 4.20.1 =
1
+ = 4.21.3 =
2
2
 
3
- -Add indent-ignore and indent-reset comment processing to analyzer
3
+ - Ignore indentation in multi-line xml comments
4
+
5
+ = 4.21.2 =
6
+
7
+ - Fix bundler load paths for later versions of ruby
8
+
9
+ = 4.21.1 =
10
+
11
+ - Add indent-ignore and indent-reset comment processing to analyzer
12
+
13
+ = 4.21.0 =
14
+
15
+ - Add post stage/unstage hooks
4
16
 
5
17
  = 4.20.0 =
6
18
 
data/bin/roku CHANGED
@@ -4,6 +4,8 @@
4
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
5
 
6
6
  #require "byebug"
7
+ require "rubygems"
8
+ require "bundler/setup"
7
9
  require "roku_builder"
8
10
 
9
11
  RokuBuilder.run()
@@ -4,7 +4,6 @@ require "logger"
4
4
  require "faraday"
5
5
  require "faraday/digestauth"
6
6
  require "pathname"
7
- require "rubygems"
8
7
  require "optparse"
9
8
  require "pathname"
10
9
  require "net/ping"
@@ -201,7 +200,7 @@ module RokuBuilder
201
200
  stager.stage
202
201
  end
203
202
  instance = plugin.new(config: @@config)
204
- instance.send(@@options.command, {options: @@options})
203
+ instance.send(@@options.command, **{options: @@options})
205
204
  stager.unstage if stager
206
205
  end
207
206
  end
@@ -225,7 +224,7 @@ module RokuBuilder
225
224
  def self.process_hook(hook:, params:)
226
225
  @@plugins.each do |plugin|
227
226
  if plugin.respond_to?("#{hook}_hook".to_sym)
228
- plugin.send("#{hook}_hook", params)
227
+ plugin.send("#{hook}_hook", **params)
229
228
  end
230
229
  end
231
230
  end
@@ -89,7 +89,7 @@ module RokuBuilder
89
89
  attrs = {}
90
90
  attrs[section_singular] = content
91
91
  method = "validate_#{section_singular}".to_sym
92
- send(method, attrs)
92
+ send(method, **attrs)
93
93
  end
94
94
 
95
95
  def singularize(section:)
@@ -30,6 +30,7 @@ module RokuBuilder
30
30
  def analyze(options:, quiet: false)
31
31
  @options = options
32
32
  @warnings = []
33
+ @sca_warning = {}
33
34
  performance_config = get_config("performance_config.json")
34
35
  linter_config = get_config(".roku_builder_linter.json", true)
35
36
  linter_config ||= {is_ssai: false}
@@ -13,11 +13,11 @@ module RokuBuilder
13
13
  @ind = 0
14
14
  end
15
15
 
16
- def check_line(line:, number:)
17
- #byebug if number == 43 and @path.ends_with?("keyEvents.brs")
16
+ def check_line(line:, number:, comment:)
17
+ #byebug if number == 10 and @path.ends_with?(".brs")
18
18
  set_indentation(line: line)
19
19
  regexp = /^#{@character}{#{@ind}}[^#{@character}]/
20
- unless line =~ regexp or line == "\n" or line =~ /\'indent-ignore/
20
+ unless line =~ regexp or line == "\n" or line =~ /\'indent-ignore/ or comment
21
21
  add_warning(line: number)
22
22
  end
23
23
  @prev_line = line
@@ -13,38 +13,49 @@ module RokuBuilder
13
13
  File.open(file_path) do |file|
14
14
  in_xml_comment = false
15
15
  indent_inspector = IndentationInspector.new(rules: @indent_config, path: file_path) if @indent_config
16
+ full_file = []
17
+ file_no_comments = []
18
+ lines_to_ignore = []
16
19
  file.readlines.each_with_index do |line, line_number|
17
- indent_inspector.check_line(line: line, number: line_number) if indent_inspector
18
20
  full_line = line.dup
19
- line = line.partition("'").first if file_path.end_with?(".brs")
21
+ line.gsub!(/'.*/, "") if file_path.end_with?(".brs")
20
22
  if file_path.end_with?(".xml")
21
23
  if in_xml_comment
22
24
  if line.gsub!(/.*-->/, "")
23
25
  in_xml_comment = false
24
26
  else
25
- line = ""
27
+ line = "\n"
26
28
  end
27
29
  end
28
30
  line.gsub!(/<!--.*-->/, "")
29
31
  in_xml_comment = true if line.gsub!(/<!--.*/, "")
30
32
  end
31
- @inspector_config.each do |line_inspector|
32
- line_to_check = line
33
- line_to_check = full_line if line_inspector[:include_comments]
34
- match = nil
35
- if line_inspector[:case_sensitive]
36
- match = /#{line_inspector[:regex]}/.match(line_to_check)
37
- else
38
- match = /#{line_inspector[:regex]}/i.match(line_to_check)
39
- end
40
- if match
41
- unless /'.*ignore-warning/i.match(full_line)
42
- add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
43
- end
44
- end
33
+ indent_inspector.check_line(line: full_line, number: line_number, comment: in_xml_comment) if indent_inspector
34
+ if /'.*ignore-warning/i.match(full_line)
35
+ lines_to_ignore.push line_number
45
36
  end
37
+ full_file.push(full_line)
38
+ file_no_comments.push(line)
46
39
  end
47
40
  @warnings += indent_inspector.warnings if indent_inspector
41
+ no_comments = file_no_comments.join("")
42
+ file = full_file.join("")
43
+ @inspector_config.each do |line_inspector|
44
+ to_check = no_comments
45
+ to_check = file if line_inspector[:include_comments]
46
+ match = nil
47
+ if line_inspector[:case_sensitive]
48
+ match = /#{line_inspector[:regex]}/.match(to_check)
49
+ else
50
+ match = /#{line_inspector[:regex]}/i.match(to_check)
51
+ end
52
+ if match
53
+ line_number = to_check[0..match.begin(0)].split("\n", -1).count - 1
54
+ unless lines_to_ignore.include?(line_number)
55
+ add_warning(inspector: line_inspector, file: file_path, line: line_number, match: match)
56
+ end
57
+ end
58
+ end
48
59
  end
49
60
  @warnings
50
61
  end
@@ -7,7 +7,7 @@ module RokuBuilder
7
7
  extend Plugin
8
8
 
9
9
  def init
10
- @warningFileSize = 250 * 1024
10
+ @warningFileSize = 500 * 1024
11
11
  end
12
12
 
13
13
  def self.commands
@@ -37,6 +37,9 @@ module RokuBuilder
37
37
  parser.on("-x", "--exclude", "Apply exclude config to sideload") do
38
38
  options[:exclude] = true
39
39
  end
40
+ parser.on("--remote-debug", "Sideload will enable remote debug") do
41
+ options[:remoteDebug] = true
42
+ end
40
43
  end
41
44
 
42
45
  def self.dependencies
@@ -52,7 +55,7 @@ module RokuBuilder
52
55
  build(options: options)
53
56
  end
54
57
  keep_build_file = is_build_command(options) and options[:out]
55
- upload
58
+ upload(options)
56
59
  # Cleanup
57
60
  File.delete(file_path(:in)) if did_build and not keep_build_file
58
61
  end
@@ -99,11 +102,12 @@ module RokuBuilder
99
102
  [:sideload, :build].include? options.command
100
103
  end
101
104
 
102
- def upload
105
+ def upload(options)
103
106
  payload = {
104
107
  mysubmit: "Replace",
105
- archive: Faraday::UploadIO.new(file_path(:in), 'application/zip')
108
+ archive: Faraday::UploadIO.new(file_path(:in), 'application/zip'),
106
109
  }
110
+ payload["remotedebug"] = "1" if options[:remoteDebug]
107
111
  response = multipart_connection.post "/plugin_install", payload
108
112
  @logger.debug("Status: #{response.status}, Body: #{response.body}")
109
113
  if response.status==200 and response.body=~/Identical to previous version/
@@ -10,7 +10,7 @@
10
10
  "message": "Found DoesExist check. Try using invalid check on dot reference"
11
11
  },
12
12
  {
13
- "regex": "[^\\s]+\\[\"[^\"]+\"\\]",
13
+ "regex": "\\w+\\[\"[^\"]+\"\\]",
14
14
  "severity": "warning",
15
15
  "message": "Found AA String reference. Try switching to dot reference"
16
16
  },
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "4.21.1"
5
+ VERSION = "4.21.6"
6
6
  end
@@ -106,7 +106,7 @@ module RokuBuilder
106
106
  warnings = test_file(text: "function test() as String 'IGNORE-WARNING\n? \"test\"\nend function")
107
107
  assert_equal 0, warnings.count
108
108
  end
109
- def test_performance_for_loop_title_case
109
+ def test_performance_for_each_loop_title_case
110
110
  warnings = test_file(text: "For each button in buttons\n ? button\nEND FOR")
111
111
  assert_equal 0, warnings.count
112
112
  end
@@ -148,6 +148,7 @@ module RokuBuilder
148
148
  end
149
149
 
150
150
  logger.verify
151
+ warnings
151
152
  end
152
153
 
153
154
  def test(quiet=true)
@@ -32,7 +32,8 @@ module RokuBuilder
32
32
  end
33
33
  count = 0
34
34
  read_stub = Proc.new do |size|
35
- raise SystemExit if count = 2
35
+ shouldExit = (count = 2)
36
+ raise SystemExit if shouldExit
36
37
  count += 1
37
38
  end
38
39
  connection = Minitest::Mock.new
@@ -32,14 +32,13 @@ module RokuBuilder
32
32
  end
33
33
  def test_options_parse
34
34
  parser = Minitest::Mock.new()
35
- options_hash = {}
36
35
  options = Options.allocate
37
36
  parser.expect(:banner=, nil, [String])
38
37
  parser.expect(:parse!, nil)
39
38
  OptionParser.stub(:new, parser) do
40
39
  options.stub(:add_plugin_options, nil) do
41
40
  options.stub(:validate_parser, nil) do
42
- options_hash = options.send(:parse)
41
+ options.send(:parse)
43
42
  end
44
43
  end
45
44
  end
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.21.1
4
+ version: 4.21.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-19 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -616,7 +616,7 @@ homepage: ''
616
616
  licenses:
617
617
  - Apache-2.0
618
618
  metadata: {}
619
- post_install_message:
619
+ post_install_message:
620
620
  rdoc_options: []
621
621
  require_paths:
622
622
  - lib
@@ -631,9 +631,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
631
631
  - !ruby/object:Gem::Version
632
632
  version: '0'
633
633
  requirements: []
634
- rubyforge_project:
635
- rubygems_version: 2.7.9
636
- signing_key:
634
+ rubygems_version: 3.0.8
635
+ signing_key:
637
636
  specification_version: 4
638
637
  summary: Build Tool for Roku Apps
639
638
  test_files: