roku_builder 4.21.0 → 4.21.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/.travis.yml +1 -1
- data/CHANGELOG +16 -0
- data/bin/roku +2 -0
- data/lib/roku_builder.rb +2 -3
- data/lib/roku_builder/config_validator.rb +1 -1
- data/lib/roku_builder/plugins/analyzer.rb +1 -0
- data/lib/roku_builder/plugins/indentation_inspector.rb +31 -27
- data/lib/roku_builder/plugins/line_inspector.rb +1 -1
- data/lib/roku_builder/plugins/loader.rb +8 -4
- data/lib/roku_builder/version.rb +1 -1
- data/test/roku_builder/plugins/test_analyzer.rb +2 -1
- data/test/roku_builder/plugins/test_profiler.rb +2 -1
- data/test/roku_builder/test_options.rb +1 -2
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a3ef1eb871ea4979ed73ece95c1211b2435f6651e118add52434b163268c5a8
|
4
|
+
data.tar.gz: af458ef520e7d7cfb1a93a7d2df1df4c6b885aebc338ddd624100afe8c90aca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3ba492b2dcb170dba88e48e77022b537cd1b36c5d98da91788fb4f6d8e8dfce92b706bf57197bc1639f5501c617750b8ba541796b456252c3f8133c645b69ad
|
7
|
+
data.tar.gz: 8ee571d3ee816221ba12c9a2b2e59456f420a6ab09c7de5de6e9ab8ac70ca0e431dba3d7be13b8d21db492cf4876a25599605fa1547c11844c3330e6d864a072
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
= 4.21.3 =
|
2
|
+
|
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
|
16
|
+
|
1
17
|
= 4.20.0 =
|
2
18
|
|
3
19
|
- Add file size warning
|
data/bin/roku
CHANGED
data/lib/roku_builder.rb
CHANGED
@@ -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
|
@@ -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 ==
|
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"
|
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
|
@@ -37,33 +37,37 @@ module RokuBuilder
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
when :brs
|
40
|
-
if
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
@
|
45
|
-
|
46
|
-
@
|
47
|
-
|
48
|
-
@
|
49
|
-
|
50
|
-
|
40
|
+
if line =~ /'indent-reset/
|
41
|
+
@ind = line.index(/[^#{@character}]/)
|
42
|
+
else
|
43
|
+
if @prev_line
|
44
|
+
if @prev_line =~ /^\'/ or @prev_line =~ /\'indent-ignore/
|
45
|
+
# Don't change indentation
|
46
|
+
elsif @prev_line =~ /[\{\[\(:]$/
|
47
|
+
@ind += @count
|
48
|
+
elsif @prev_line =~ /:\s*\bfunction\b|:\s*\bsub\b/i
|
49
|
+
@ind += @count
|
50
|
+
elsif @prev_line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
|
51
|
+
@ind += @count
|
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
|
54
|
+
@ind += @count
|
55
|
+
end
|
56
|
+
elsif @prev_line =~ /^\s*\bfor\b|^\s*\bwhile\b/i
|
51
57
|
@ind += @count
|
52
58
|
end
|
53
|
-
elsif @prev_line =~ /^\s*\bfor\b|^\s*\bwhile\b/i
|
54
|
-
@ind += @count
|
55
59
|
end
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
60
|
+
if line =~ /^\'/ or line =~ /\'indent-ignore/
|
61
|
+
# Don't change indentation
|
62
|
+
elsif line =~ /^\s*[\}\]\)]/
|
63
|
+
@ind -= @count
|
64
|
+
elsif line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
|
65
|
+
@ind -= 0
|
66
|
+
elsif line =~ /^\s*:?\s*#?end\b|^\s*#?endif\b|^\s*endfor\b|^\s*\bnext\b/i
|
67
|
+
@ind -= @count
|
68
|
+
elsif line =~ /^\s*#?else\b|^\s*elseif\b/i
|
69
|
+
@ind -= @count
|
70
|
+
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
@@ -14,7 +14,6 @@ module RokuBuilder
|
|
14
14
|
in_xml_comment = false
|
15
15
|
indent_inspector = IndentationInspector.new(rules: @indent_config, path: file_path) if @indent_config
|
16
16
|
file.readlines.each_with_index do |line, line_number|
|
17
|
-
indent_inspector.check_line(line: line, number: line_number) if indent_inspector
|
18
17
|
full_line = line.dup
|
19
18
|
line = line.partition("'").first if file_path.end_with?(".brs")
|
20
19
|
if file_path.end_with?(".xml")
|
@@ -28,6 +27,7 @@ module RokuBuilder
|
|
28
27
|
line.gsub!(/<!--.*-->/, "")
|
29
28
|
in_xml_comment = true if line.gsub!(/<!--.*/, "")
|
30
29
|
end
|
30
|
+
indent_inspector.check_line(line: full_line, number: line_number, comment: in_xml_comment) if indent_inspector
|
31
31
|
@inspector_config.each do |line_inspector|
|
32
32
|
line_to_check = line
|
33
33
|
line_to_check = full_line if line_inspector[:include_comments]
|
@@ -7,7 +7,7 @@ module RokuBuilder
|
|
7
7
|
extend Plugin
|
8
8
|
|
9
9
|
def init
|
10
|
-
@warningFileSize =
|
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/
|
data/lib/roku_builder/version.rb
CHANGED
@@ -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
|
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,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
|
-
|
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.
|
4
|
+
version: 4.21.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-27 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
|
-
|
635
|
-
|
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:
|