roku_builder 3.12.2 → 3.12.4
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/CHANGELOG +9 -0
- data/Gemfile.lock +9 -5
- data/bin/roku +4 -0
- data/lib/roku_builder/config_manager.rb +18 -12
- data/lib/roku_builder/config_parser.rb +3 -0
- data/lib/roku_builder/config_validator.rb +14 -21
- data/lib/roku_builder/monitor.rb +9 -4
- data/lib/roku_builder/version.rb +1 -1
- data/roku_builder.gemspec +1 -0
- data/test/roku_builder/test_config_parser.rb +11 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6465e57b5cb5dad5fb1606d51f9469d6334c39a
|
4
|
+
data.tar.gz: 8e0fbdbef24e1dd4d283b82a54313a8e6605aac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3c26fb3b92fa5e9ef0e5655049a68aa3811f22a8807bb76087d70f355f299be662356340512deca359b0fdd04208ed6d9f7c495e729811ceb56dc3fa276a3dc
|
7
|
+
data.tar.gz: 1ed8966ed21dec4b74eccd1236649c375336977b8d422d35296059157bb4bb3adcb2d785018faac535d06f41fc855d3af2975c0dba95ad972e90e5d2de699a64
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
roku_builder (3.12.
|
4
|
+
roku_builder (3.12.4)
|
5
5
|
faraday (~> 0.11)
|
6
6
|
faraday-digestauth (~> 0.2)
|
7
7
|
git (~> 1.3)
|
@@ -30,7 +30,7 @@ GEM
|
|
30
30
|
ffi (1.9.17)
|
31
31
|
formatador (0.2.5)
|
32
32
|
git (1.3.0)
|
33
|
-
guard (2.14.
|
33
|
+
guard (2.14.1)
|
34
34
|
formatador (>= 0.2.4)
|
35
35
|
listen (>= 2.7, < 4.0)
|
36
36
|
lumberjack (~> 1.0)
|
@@ -49,6 +49,9 @@ GEM
|
|
49
49
|
rb-inotify (~> 0.9, >= 0.9.7)
|
50
50
|
ruby_dep (~> 1.2)
|
51
51
|
lumberjack (1.0.11)
|
52
|
+
m (1.5.0)
|
53
|
+
method_source (>= 0.6.7)
|
54
|
+
rake (>= 0.9.2.2)
|
52
55
|
method_source (0.8.2)
|
53
56
|
mini_portile2 (2.1.0)
|
54
57
|
minitest (5.10.1)
|
@@ -58,7 +61,7 @@ GEM
|
|
58
61
|
minitest (~> 5.0)
|
59
62
|
multipart-post (2.0.0)
|
60
63
|
nenv (0.3.0)
|
61
|
-
net-http-digest_auth (1.4)
|
64
|
+
net-http-digest_auth (1.4.1)
|
62
65
|
net-ping (2.0.1)
|
63
66
|
net-telnet (0.1.1)
|
64
67
|
nokogiri (1.7.0.1)
|
@@ -75,7 +78,7 @@ GEM
|
|
75
78
|
rb-inotify (0.9.8)
|
76
79
|
ffi (>= 0.5.0)
|
77
80
|
ruby_dep (1.5.0)
|
78
|
-
rubyzip (1.2.
|
81
|
+
rubyzip (1.2.1)
|
79
82
|
shellany (0.0.1)
|
80
83
|
simplecov (0.12.0)
|
81
84
|
docile (~> 1.1.0)
|
@@ -86,7 +89,7 @@ GEM
|
|
86
89
|
term-ansicolor (1.4.0)
|
87
90
|
tins (~> 1.0)
|
88
91
|
thor (0.19.4)
|
89
|
-
tins (1.13.
|
92
|
+
tins (1.13.2)
|
90
93
|
yard (0.9.8)
|
91
94
|
|
92
95
|
PLATFORMS
|
@@ -98,6 +101,7 @@ DEPENDENCIES
|
|
98
101
|
coveralls (~> 0.8)
|
99
102
|
guard (~> 2.14)
|
100
103
|
guard-minitest (~> 2.4)
|
104
|
+
m (~> 1.5)
|
101
105
|
minitest (~> 5.10)
|
102
106
|
minitest-autotest (~> 1.0)
|
103
107
|
minitest-server (~> 1.0)
|
data/bin/roku
CHANGED
@@ -170,6 +170,10 @@ parser = OptionParser.new do |opts|
|
|
170
170
|
options[:in] = i
|
171
171
|
end
|
172
172
|
|
173
|
+
opts.on("-r", "--regexp REGEXP", "A regular expression used to filter monitor logs") do |r|
|
174
|
+
options[:regexp] = r
|
175
|
+
end
|
176
|
+
|
173
177
|
opts.on("-x", "--exclude", "Apply exclude config to sideload") do
|
174
178
|
options[:exclude] = true
|
175
179
|
end
|
@@ -46,18 +46,8 @@ module RokuBuilder
|
|
46
46
|
# @return [Hash] roku config object
|
47
47
|
def self.get_config(config:, logger:)
|
48
48
|
begin
|
49
|
-
config =
|
50
|
-
|
51
|
-
while config[:parent_config]
|
52
|
-
config_parent = JSON.parse(File.open(config[:parent_config]).read, {symbolize_names: true})
|
53
|
-
config.delete(:parent_config)
|
54
|
-
config.merge!(config_parent) {|key, v1, v2| v1}
|
55
|
-
depth += 1
|
56
|
-
if depth > 10
|
57
|
-
logger.fatal "Parent configs too deep."
|
58
|
-
return nil
|
59
|
-
end
|
60
|
-
end
|
49
|
+
config = build_config(config: config, logger: logger)
|
50
|
+
return nil unless config
|
61
51
|
config[:devices][:default] = config[:devices][:default].to_sym
|
62
52
|
config[:projects][:default] = config[:projects][:default].to_sym
|
63
53
|
config[:projects].each_pair do |key,value|
|
@@ -83,6 +73,22 @@ module RokuBuilder
|
|
83
73
|
end
|
84
74
|
end
|
85
75
|
|
76
|
+
def self.build_config(config:, logger:)
|
77
|
+
config = {parent_config: config}
|
78
|
+
depth = 1
|
79
|
+
while config[:parent_config]
|
80
|
+
config_parent = JSON.parse(File.open(config[:parent_config]).read, {symbolize_names: true})
|
81
|
+
config.delete(:parent_config)
|
82
|
+
config.merge!(config_parent) {|_key, v1, _v2| v1}
|
83
|
+
depth += 1
|
84
|
+
if depth > 10
|
85
|
+
logger.fatal "Parent configs too deep."
|
86
|
+
return nil
|
87
|
+
end
|
88
|
+
end
|
89
|
+
config
|
90
|
+
end
|
91
|
+
|
86
92
|
|
87
93
|
# Edit the roku config
|
88
94
|
# @param config [String] path for the roku config
|
@@ -227,6 +227,9 @@ module RokuBuilder
|
|
227
227
|
# Create Monitor Config
|
228
228
|
if options[:monitor]
|
229
229
|
configs[:monitor_config] = {type: options[:monitor].to_sym}
|
230
|
+
if options[:regexp]
|
231
|
+
configs[:monitor_config][:regexp] = /#{options[:regexp]}/
|
232
|
+
end
|
230
233
|
end
|
231
234
|
# Create Navigate Config
|
232
235
|
mappings = {}
|
@@ -36,28 +36,21 @@ module RokuBuilder
|
|
36
36
|
def self.validate_config(config:)
|
37
37
|
codes = []
|
38
38
|
validate_structure(codes: codes, config: config)
|
39
|
-
|
40
|
-
config[
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
}
|
39
|
+
[:projects, :devices, :keys].each do |type|
|
40
|
+
if config[type]
|
41
|
+
config[type].each do |key, value|
|
42
|
+
next if [:default, :key_dir, :project_dir].include?(key)
|
43
|
+
method = "validate_#{type.to_s[0..-2]}".to_sym
|
44
|
+
attrs = {codes: codes}
|
45
|
+
attrs[type.to_s[0..-2].to_sym] = value
|
46
|
+
send(method, attrs)
|
47
|
+
if value[:stages]
|
48
|
+
value[:stages].each {|_stage, stage_config|
|
49
|
+
validate_stage(codes: codes, stage: stage_config, project: value, config: config)
|
50
|
+
}
|
51
|
+
end
|
53
52
|
end
|
54
|
-
|
55
|
-
end
|
56
|
-
if config[:keys]
|
57
|
-
config[:keys].each {|key,key_config|
|
58
|
-
next if key == :key_dir
|
59
|
-
validate_key(codes: codes, key: key_config)
|
60
|
-
}
|
53
|
+
end
|
61
54
|
end
|
62
55
|
if config[:input_mapping]
|
63
56
|
config[:input_mapping].each_value {|info| validate_mapping(codes: codes, mapping: info) }
|
data/lib/roku_builder/monitor.rb
CHANGED
@@ -21,7 +21,8 @@ module RokuBuilder
|
|
21
21
|
|
22
22
|
# Monitor a development log on the Roku device
|
23
23
|
# @param type [Symbol] The log type to monitor
|
24
|
-
|
24
|
+
# @param regexp [Regexp] regular expression to filter text on
|
25
|
+
def monitor(type:, regexp: nil)
|
25
26
|
telnet_config = { 'Host' => @roku_ip_address, 'Port' => @ports[type] }
|
26
27
|
waitfor_config = { 'Match' => /./, 'Timeout' => false }
|
27
28
|
|
@@ -32,7 +33,7 @@ module RokuBuilder
|
|
32
33
|
all_text = ""
|
33
34
|
while true
|
34
35
|
connection.waitfor(waitfor) do |txt|
|
35
|
-
all_text = manage_text(all_text: all_text, txt: txt)
|
36
|
+
all_text = manage_text(all_text: all_text, txt: txt, regexp: regexp)
|
36
37
|
end
|
37
38
|
end
|
38
39
|
}
|
@@ -87,6 +88,7 @@ module RokuBuilder
|
|
87
88
|
running = false
|
88
89
|
else
|
89
90
|
thread[:connection].puts(command)
|
91
|
+
sleep(0.1)
|
90
92
|
end
|
91
93
|
rescue SystemExit, Interrupt
|
92
94
|
thread[:connection].puts("\C-c")
|
@@ -97,11 +99,14 @@ module RokuBuilder
|
|
97
99
|
# Handle text from telnet
|
98
100
|
# @param all_text [String] remaining partial line text
|
99
101
|
# @param txt [String] current string from telnet
|
102
|
+
# @param regexp [Regexp] regular expression to filter text on
|
100
103
|
# @return [String] remaining partial line text
|
101
|
-
def manage_text(all_text:, txt:)
|
104
|
+
def manage_text(all_text:, txt:, regexp: nil)
|
102
105
|
all_text += txt
|
103
106
|
while line = all_text.slice!(/^.*\n/) do
|
104
|
-
|
107
|
+
if !line.strip.empty?
|
108
|
+
puts line if regexp.nil? or regexp.match(line)
|
109
|
+
end
|
105
110
|
end
|
106
111
|
|
107
112
|
if all_text.downcase == "BrightScript Debugger> ".downcase
|
data/lib/roku_builder/version.rb
CHANGED
data/roku_builder.gemspec
CHANGED
@@ -195,6 +195,17 @@ class ConfigParserTest < Minitest::Test
|
|
195
195
|
RokuBuilder::ConfigParser.send(:setup_simple_configs, **args)
|
196
196
|
end
|
197
197
|
|
198
|
+
def test_monitor_config
|
199
|
+
args = {
|
200
|
+
config: {},
|
201
|
+
configs: {project_config: {directory: "dir"}, init_params: {}, out: {}},
|
202
|
+
options: {monitor: "main", regexp: "^A$"},
|
203
|
+
}
|
204
|
+
RokuBuilder::ConfigParser.send(:setup_active_configs, **args)
|
205
|
+
refute_nil args[:configs][:monitor_config][:regexp]
|
206
|
+
assert args[:configs][:monitor_config][:regexp].match("A")
|
207
|
+
end
|
208
|
+
|
198
209
|
def test_outfile_config
|
199
210
|
configs = {}
|
200
211
|
args = {
|
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: 3.12.
|
4
|
+
version: 3.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- greeneca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -262,6 +262,20 @@ dependencies:
|
|
262
262
|
- - "~>"
|
263
263
|
- !ruby/object:Gem::Version
|
264
264
|
version: '2.4'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: m
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '1.5'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '1.5'
|
265
279
|
description: Allows the user to easily sideload, package, deeplink, test, roku apps.
|
266
280
|
email:
|
267
281
|
- charles.greene@redspace.com
|