roku_builder 4.22.6 → 4.23.0
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/lib/roku_builder/config.rb +5 -0
- data/lib/roku_builder/plugins/analyzer.rb +8 -1
- data/lib/roku_builder/plugins/core.rb +27 -2
- data/lib/roku_builder/plugins/indentation_inspector.rb +5 -1
- data/lib/roku_builder/version.rb +1 -1
- data/test/roku_builder/plugins/test_core.rb +19 -0
- data/test/roku_builder/test_config.rb +31 -0
- data/test/roku_builder/test_files/analyzer_test/images/focus_hd.png +0 -0
- data/test/roku_builder/test_files/analyzer_test/source/main.brs +4 -0
- data/test/roku_builder/test_files/config_test/local_sub.json +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 373790650070231c745746cd44c6ad316f34746e27fd73a4849b2d02279df624
|
4
|
+
data.tar.gz: de065657de7cf806f4db60a01230eef93d1f92aba581c5456752367e01554900
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16a02701b5eaed8f0f6dbee5edd0c42d3f26481139384aac9ecc545c96695259d0c4509274b3543cf5fd137c55f9ae19e27dda9f21a0813a725f6d1e0ae870ce
|
7
|
+
data.tar.gz: 01fbc2cd1d4bf08f4ee2f8a8fed846300d0a6629b54cb6a45484af7b4ff0388dde3ebfc84ac7d940bed5697700c5be690bc7491c10fcc366a374c59a8caaf75f
|
data/lib/roku_builder/config.rb
CHANGED
@@ -126,7 +126,12 @@ module RokuBuilder
|
|
126
126
|
if File.exist?(local_config_path) and !@loaded_configs.include?(File.expand_path(local_config_path))
|
127
127
|
local_config_hash = read_config(File.open(local_config_path))
|
128
128
|
add_missing_directories(local_config_hash)
|
129
|
+
local_sub_configs = "./.roku_config/*.json"
|
129
130
|
@config = @config.deep_merge(local_config_hash)
|
131
|
+
Dir.glob("./.roku_config/*.json").each do |sub_config_path|
|
132
|
+
sub_config_hash = read_config(File.open(sub_config_path))
|
133
|
+
@config = @config.deep_merge(sub_config_hash)
|
134
|
+
end
|
130
135
|
end
|
131
136
|
end
|
132
137
|
|
@@ -65,11 +65,13 @@ module RokuBuilder
|
|
65
65
|
def run_sca_tool(path:, ssai:)
|
66
66
|
if OS.unix?
|
67
67
|
command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd")
|
68
|
+
stderr = "/dev/null"
|
68
69
|
else
|
69
70
|
command = File.join(File.dirname(__FILE__), "sca-cmd", "bin", "sca-cmd.bat")
|
71
|
+
stderr = "nul"
|
70
72
|
end
|
71
73
|
@logger.debug("Command: '#{command}'")
|
72
|
-
results = `#{command} #{path}`.split("\n")
|
74
|
+
results = `#{command} #{path} 2>#{stderr}`.split("\n")
|
73
75
|
process_sca_results(results, ssai)
|
74
76
|
end
|
75
77
|
|
@@ -96,6 +98,11 @@ module RokuBuilder
|
|
96
98
|
if ssai and /SetAdUrl\(\) method is missing/.match(@sca_warning[:message])
|
97
99
|
return false
|
98
100
|
end
|
101
|
+
libraries = @config.project[:libraries]
|
102
|
+
libraries ||= []
|
103
|
+
if @sca_warning[:path] and libraries.any_is_start?(@sca_warning[:path].gsub(/pkg:/, "")) and not @options[:include_libraries]
|
104
|
+
return false
|
105
|
+
end
|
99
106
|
return true
|
100
107
|
end
|
101
108
|
return false
|
@@ -75,8 +75,9 @@ module RokuBuilder
|
|
75
75
|
parser.on("--debug", "Print Debug messages") do
|
76
76
|
options[:debug] = true
|
77
77
|
end
|
78
|
-
parser.on("-h", "--help", "Show
|
79
|
-
|
78
|
+
parser.on("-h", "--help [PLUGIN]", "Show help") do |h|
|
79
|
+
help_text = self.get_help_text(parser: parser, options: options, plugin_name: h)
|
80
|
+
puts help_text
|
80
81
|
exit
|
81
82
|
end
|
82
83
|
parser.on("-v", "--version", "Show version") do
|
@@ -112,6 +113,30 @@ module RokuBuilder
|
|
112
113
|
def dounstage(options:)
|
113
114
|
Stager.new(config: @config, options: options).unstage
|
114
115
|
end
|
116
|
+
|
117
|
+
def self.get_help_text(parser:, options:, plugin_name:)
|
118
|
+
plugin = self.get_plugin_by_name(plugin_name)
|
119
|
+
if nil == plugin
|
120
|
+
return parser.to_s
|
121
|
+
else
|
122
|
+
pluginParser = OptionParser.new
|
123
|
+
pluginParser.separator ""
|
124
|
+
pluginParser.separator "Options for #{plugin}:"
|
125
|
+
plugin.parse_options(parser: pluginParser, options: options)
|
126
|
+
return pluginParser.to_s
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def self.get_plugin_by_name(name)
|
131
|
+
if name.nil?
|
132
|
+
return nil
|
133
|
+
end
|
134
|
+
pluginIndex = RokuBuilder.plugins.map{|pluginClass| pluginClass.name.split('::').last().downcase}.index(name.downcase)
|
135
|
+
if !pluginIndex.nil?
|
136
|
+
plugin = RokuBuilder.plugins[pluginIndex]
|
137
|
+
return plugin
|
138
|
+
end
|
139
|
+
end
|
115
140
|
end
|
116
141
|
RokuBuilder.register_plugin(Core)
|
117
142
|
end
|
@@ -55,6 +55,8 @@ module RokuBuilder
|
|
55
55
|
end
|
56
56
|
elsif @prev_line =~ /^\s*\bfor\b|^\s*\bwhile\b/i
|
57
57
|
@ind += @count
|
58
|
+
elsif @prev_line =~ /^\s*\btry\b|^\s*\bcatch\b/i
|
59
|
+
@ind += @count
|
58
60
|
end
|
59
61
|
end
|
60
62
|
if line =~ /^\'/ or line =~ /\'indent-ignore/
|
@@ -62,11 +64,13 @@ module RokuBuilder
|
|
62
64
|
elsif line =~ /^\s*[\}\]\)]/
|
63
65
|
@ind -= @count
|
64
66
|
elsif line =~ /^\s*\bfunction\b|^\s*\bsub\b/i
|
65
|
-
|
67
|
+
# Don't change indentation
|
66
68
|
elsif line =~ /^\s*:?\s*#?end\b|^\s*#?endif\b|^\s*endfor\b|^\s*\bnext\b/i
|
67
69
|
@ind -= @count
|
68
70
|
elsif line =~ /^\s*#?else\b|^\s*elseif\b/i
|
69
71
|
@ind -= @count
|
72
|
+
elsif line =~ /^\s*#?catch\b/i
|
73
|
+
@ind -= @count
|
70
74
|
end
|
71
75
|
end
|
72
76
|
end
|
data/lib/roku_builder/version.rb
CHANGED
@@ -108,6 +108,25 @@ module RokuBuilder
|
|
108
108
|
core.dounstage(options: options)
|
109
109
|
end
|
110
110
|
end
|
111
|
+
def test_core_help
|
112
|
+
parser = OptionParser.new
|
113
|
+
options = {}
|
114
|
+
help_text = Core.get_help_text(parser: parser, options: options, plugin_name: nil)
|
115
|
+
assert help_text
|
116
|
+
end
|
117
|
+
def test_core_help_plugin
|
118
|
+
parser = OptionParser.new
|
119
|
+
options = {}
|
120
|
+
help_text = Core.get_help_text(parser: parser, options: options, plugin_name: "Loader")
|
121
|
+
assert help_text
|
122
|
+
end
|
123
|
+
def test_core_get_plugin_by_name
|
124
|
+
parser = OptionParser.new
|
125
|
+
options = {}
|
126
|
+
plugin_name = Core.get_plugin_by_name("core")
|
127
|
+
refute_nil plugin_name
|
128
|
+
assert_match "RokuBuilder::Core", plugin_name.to_s
|
129
|
+
end
|
111
130
|
end
|
112
131
|
end
|
113
132
|
|
@@ -163,6 +163,37 @@ module RokuBuilder
|
|
163
163
|
assert_equal `pwd`.chomp, config.raw[:projects][:p2][:directory]
|
164
164
|
end
|
165
165
|
|
166
|
+
def test_config_read_local_sub_config
|
167
|
+
options = build_options({config: File.join(test_files_path(ConfigTest), "config.json"), validate: true})
|
168
|
+
config = Config.new(options: options)
|
169
|
+
|
170
|
+
mock = Minitest::Mock.new
|
171
|
+
io = proc { |path|
|
172
|
+
if path == './.roku_config.json' or path == "keys.json"
|
173
|
+
mock
|
174
|
+
else
|
175
|
+
IO.new(IO.sysopen(path))
|
176
|
+
end
|
177
|
+
}
|
178
|
+
local_config_content = IO.read(File.join(test_files_path(ConfigTest), "local.json"))
|
179
|
+
mock.expect(:read, local_config_content)
|
180
|
+
local_sub_config_content = IO.read(File.join(test_files_path(ConfigTest), "local_sub.json"))
|
181
|
+
mock.expect(:read, local_sub_config_content)
|
182
|
+
|
183
|
+
File.stub(:exist?, true) do
|
184
|
+
File.stub(:open, io) do
|
185
|
+
Dir.stub(:glob, ["keys.json"]) do
|
186
|
+
config.load
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
mock.verify
|
192
|
+
refute_nil config.raw[:keys]
|
193
|
+
refute_nil config.raw[:keys][:test_key]
|
194
|
+
assert_equal "password", config.raw[:keys][:test_key][:password]
|
195
|
+
end
|
196
|
+
|
166
197
|
def test_config_edit
|
167
198
|
orginal = File.join(test_files_path(ConfigTest), "config.json")
|
168
199
|
tmp = File.join(test_files_path(ConfigTest), "tmpconfig.json")
|
Binary file
|
@@ -23,6 +23,10 @@ sub main(externalParams)
|
|
23
23
|
scene.observeField("exitApplication", port)
|
24
24
|
scene.observeField("sessionLength", port)
|
25
25
|
|
26
|
+
scene.signalBeacon("AppLaunchComplete")
|
27
|
+
scene.signalBeacon("AppDialogInitiate")
|
28
|
+
scene.signalBeacon("AppDialogComplete")
|
29
|
+
|
26
30
|
while(true)
|
27
31
|
msg = wait(0, port)
|
28
32
|
msgType = type(msg)
|
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.
|
4
|
+
version: 4.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -557,6 +557,7 @@ files:
|
|
557
557
|
- test/roku_builder/test_files/config_test/child.json
|
558
558
|
- test/roku_builder/test_files/config_test/config.json
|
559
559
|
- test/roku_builder/test_files/config_test/local.json
|
560
|
+
- test/roku_builder/test_files/config_test/local_sub.json
|
560
561
|
- test/roku_builder/test_files/config_test/multi_repeat_stages.json
|
561
562
|
- test/roku_builder/test_files/config_test/no_default_device.json
|
562
563
|
- test/roku_builder/test_files/config_test/no_default_project.json
|
@@ -684,6 +685,7 @@ test_files:
|
|
684
685
|
- test/roku_builder/test_files/config_test/child.json
|
685
686
|
- test/roku_builder/test_files/config_test/config.json
|
686
687
|
- test/roku_builder/test_files/config_test/local.json
|
688
|
+
- test/roku_builder/test_files/config_test/local_sub.json
|
687
689
|
- test/roku_builder/test_files/config_test/multi_repeat_stages.json
|
688
690
|
- test/roku_builder/test_files/config_test/no_default_device.json
|
689
691
|
- test/roku_builder/test_files/config_test/no_default_project.json
|