roku_builder 3.8.1 → 3.8.2

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
  SHA1:
3
- metadata.gz: a3374b8a07e80ff6fbc630e47407547bca348986
4
- data.tar.gz: ad8690cb4312f629218ff66a6845f3631d41208e
3
+ metadata.gz: 3f3dd0efa70ffdec9f99f7579b79b64b0d41ad96
4
+ data.tar.gz: 8f6be751c0502f1e2fd0fa6f9bc885af30228911
5
5
  SHA512:
6
- metadata.gz: 32c2f4df3680ea15fa9aaa02c66e41a5ef5dcfc7999348786068f4a3c1f4650a90a677884724921d08b9e2a6662118e77c6011a78088d80e45d0f3f39dbeae63
7
- data.tar.gz: 43e10ec15f221df63d2cf258a5c219074840366ac25205a5581362fe1c181a0c9a7a65cd4543ae55333f641681738f1690292cdd8933255a54a2e982b4c7541b
6
+ metadata.gz: efaa8062dd1ddf8d84e7960d9d241fefe55a16c7cf9056b45bdc970b27313a88c20cc8cf5c7b5c4f3bdfc83ded409720562a63f0517a97cdd7f8b2cf5d9fd19e
7
+ data.tar.gz: 6a475bd91f379f5b948730c6ba9cb201333277124132e1099053da3f0bfd6735e27c2f5803500c3407dd8da58a17152b68b71d257792b5d25133fec6abedca7e
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.2.3"
3
+ - "2.2.4"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roku_builder (3.8.0)
4
+ roku_builder (3.8.1)
5
5
  faraday (~> 0.9)
6
6
  faraday-digestauth (~> 0.2)
7
7
  git (~> 1.3)
data/bin/roku CHANGED
@@ -10,7 +10,6 @@ require "pathname"
10
10
 
11
11
  options = {}
12
12
  options[:config] = '~/.roku_config.json'
13
- options[:stage] = 'production'
14
13
  options[:update_manifest] = false
15
14
 
16
15
  OptionParser.new do |opts|
@@ -75,8 +75,6 @@ module RokuBuilder
75
75
  # Edit the roku config
76
76
  # @param config [String] path for the roku config
77
77
  # @param options [String] options to set in the config
78
- # @param device [String] which device to use
79
- # @param project [String] which project to use
80
78
  # @param stage[String] which stage to use
81
79
  # @return [Boolean] success
82
80
  def self.edit_config(config:, options:, logger:)
@@ -87,7 +85,7 @@ module RokuBuilder
87
85
  device = options[:device].to_sym if options[:device]
88
86
  device = config_object[:devices][:default] unless options[:device]
89
87
  stage = options[:stage].to_sym if options[:stage]
90
- stage = :production unless options[:stage]
88
+ stage ||= config_object[:projects][project][:stages].keys[0].to_sym
91
89
  state = {
92
90
  project: project,
93
91
  device: device,
@@ -114,8 +114,10 @@ module RokuBuilder
114
114
  # @return [Hash] The stage config hash
115
115
  def self.setup_stage_config(configs:, options:, logger:)
116
116
  stage_config = {logger: logger}
117
- stage = options[:stage].to_sym
117
+ stage = options[:stage].to_sym if options[:stage]
118
118
  project_config = configs[:project_config]
119
+ stage ||= project_config[:stages].keys[0].to_sym
120
+ options[:stage] = stage
119
121
  stage_config[:root_dir] = project_config[:directory]
120
122
  stage_config[:method] = project_config[:stage_method]
121
123
  stage_config[:method] ||= :git
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RokuBuilder
4
4
  # Version of the RokuBuilder Gem
5
- VERSION = "3.8.1"
5
+ VERSION = "3.8.2"
6
6
  end
data/roku_builder.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = "~> 2.2.3"
21
+ spec.required_ruby_version = "~> 2.2.4"
22
22
 
23
23
  spec.add_dependency "rubyzip", "~> 1.2"
24
24
  spec.add_dependency "faraday", "~> 0.9"
@@ -16,7 +16,7 @@ class ControllerCommandsTest < Minitest::Test
16
16
  loader = Minitest::Mock.new
17
17
  stager = Minitest::Mock.new
18
18
 
19
- options = {sideload: true, stage: 'production', config: "~/.roku_config.rb"}
19
+ options = {sideload: true, config: "~/.roku_config.rb"}
20
20
  config = good_config
21
21
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
22
22
  # Test Success
@@ -56,7 +56,7 @@ class ControllerCommandsTest < Minitest::Test
56
56
  packager = Minitest::Mock.new
57
57
  inspector = Minitest::Mock.new
58
58
 
59
- options = {package: true, inspect: true, stage: 'production', out_folder: "/tmp", config: "~/.roku_config.json"}
59
+ options = {package: true, inspect: true, out_folder: "/tmp", config: "~/.roku_config.json"}
60
60
  config = good_config
61
61
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
62
62
  info = {app_name: "app", dev_id: "id", creation_date: "date", dev_zip: ""}
@@ -100,7 +100,7 @@ class ControllerCommandsTest < Minitest::Test
100
100
  packager = Minitest::Mock.new
101
101
  inspector = Minitest::Mock.new
102
102
 
103
- options = {package: true, inspect: true, stage: 'production', out: "/tmp/out.pkg", config: "~/.roku_config.json"}
103
+ options = {package: true, inspect: true, out: "/tmp/out.pkg", config: "~/.roku_config.json"}
104
104
  config = good_config
105
105
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
106
106
  info = {app_name: "app", dev_id: "id", creation_date: "date", dev_zip: ""}
@@ -142,7 +142,7 @@ class ControllerCommandsTest < Minitest::Test
142
142
  stager = Minitest::Mock.new
143
143
 
144
144
  code = nil
145
- options = {build: true, stage: 'production', out_folder: "/tmp", config: "~/.roku_config.json"}
145
+ options = {build: true, out_folder: "/tmp", config: "~/.roku_config.json"}
146
146
  config = good_config
147
147
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
148
148
  loader.expect(:build, "/tmp/build", [configs[:build_config]])
@@ -167,7 +167,7 @@ class ControllerCommandsTest < Minitest::Test
167
167
  stager = Minitest::Mock.new
168
168
 
169
169
  code = nil
170
- options = {update: true, stage: 'production', out_folder: "/tmp", config: "~/.roku_config.json"}
170
+ options = {update: true, out_folder: "/tmp", config: "~/.roku_config.json"}
171
171
  config = good_config
172
172
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
173
173
  mock.expect(:call, "1", [configs[:manifest_config]])
@@ -192,7 +192,7 @@ class ControllerCommandsTest < Minitest::Test
192
192
  mock = Minitest::Mock.new
193
193
 
194
194
  code = nil
195
- options = {deeplink: true, stage: 'production', deeplink_options: "a:b", config: "~/.roku_config.json"}
195
+ options = {deeplink: true, deeplink_options: "a:b", config: "~/.roku_config.json"}
196
196
  config = good_config
197
197
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
198
198
  mock.expect(:launch, "true", [configs[:deeplink_config]])
@@ -211,7 +211,7 @@ class ControllerCommandsTest < Minitest::Test
211
211
  sideload = Proc.new {|a, b, c| ran_sideload = true}
212
212
 
213
213
  code = nil
214
- options = {deeplink: true, set_stage: true, stage: 'production', deeplink_options: "a:b", config: "~/.roku_config.json"}
214
+ options = {deeplink: true, set_stage: true, deeplink_options: "a:b", config: "~/.roku_config.json"}
215
215
  config = good_config
216
216
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
217
217
  mock.expect(:launch, "true", [configs[:deeplink_config]])
@@ -227,14 +227,19 @@ class ControllerCommandsTest < Minitest::Test
227
227
  def test_controller_commands_deeplink_fail
228
228
  logger = Logger.new("/dev/null")
229
229
  mock = Minitest::Mock.new
230
+ stager = Minitest::Mock.new
230
231
 
231
232
  code = nil
232
- options = {deeplink: true, stage: 'production', deeplink_options: "a:b", config: "~/.roku_config.json"}
233
+ options = {deeplink: true, deeplink_options: "a:b", config: "~/.roku_config.json"}
233
234
  config = good_config
234
235
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
235
236
  mock.expect(:launch, false, [configs[:deeplink_config]])
237
+ stager.expect(:stage, true)
238
+ stager.expect(:unstage, true)
236
239
  RokuBuilder::Linker.stub(:new, mock) do
237
- code = RokuBuilder::Controller.send(:execute_commands, {options: options, config: config, configs: configs, logger: logger})
240
+ RokuBuilder::Stager.stub(:new, stager) do
241
+ code = RokuBuilder::Controller.send(:execute_commands, {options: options, config: config, configs: configs, logger: logger})
242
+ end
238
243
  end
239
244
  mock.verify
240
245
  assert_equal RokuBuilder::FAILED_DEEPLINKING, code
@@ -243,7 +248,7 @@ class ControllerCommandsTest < Minitest::Test
243
248
  logger = Logger.new("/dev/null")
244
249
  loader = Minitest::Mock.new
245
250
 
246
- options = {delete: true, stage: 'production', config: "~/.roku_config.json"}
251
+ options = {delete: true, config: "~/.roku_config.json"}
247
252
  config = good_config
248
253
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
249
254
  loader.expect(:unload, nil)
@@ -260,7 +265,7 @@ class ControllerCommandsTest < Minitest::Test
260
265
  logger = Logger.new("/dev/null")
261
266
  monitor = Minitest::Mock.new
262
267
 
263
- options = {monitor: "main", stage: 'production', config: "~/.roku_config.json"}
268
+ options = {monitor: "main", config: "~/.roku_config.json"}
264
269
  config = good_config
265
270
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
266
271
  monitor.expect(:monitor, nil, [configs[:monitor_config]])
@@ -277,7 +282,7 @@ class ControllerCommandsTest < Minitest::Test
277
282
  logger = Logger.new("/dev/null")
278
283
  navigator = Minitest::Mock.new
279
284
 
280
- options = {navigate: "up", stage: 'production', config: ":execute_commands,/.roku_config.json"}
285
+ options = {navigate: "up", config: ":execute_commands,/.roku_config.json"}
281
286
  config = good_config
282
287
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
283
288
  navigator.expect(:nav, true, [configs[:navigate_config]])
@@ -292,7 +297,7 @@ class ControllerCommandsTest < Minitest::Test
292
297
  logger = Logger.new("/dev/null")
293
298
  navigator = Minitest::Mock.new
294
299
 
295
- options = {navigate: "up", stage: 'production', config: ":execute_commands,/.roku_config.json"}
300
+ options = {navigate: "up", config: ":execute_commands,/.roku_config.json"}
296
301
  config = good_config
297
302
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
298
303
  navigator.expect(:nav, nil, [configs[:navigate_config]])
@@ -307,7 +312,7 @@ class ControllerCommandsTest < Minitest::Test
307
312
  logger = Logger.new("/dev/null")
308
313
  navigator = Minitest::Mock.new
309
314
 
310
- options = {screen: "secret", stage: 'production', config: ":execute_commands,/.roku_config.json"}
315
+ options = {screen: "secret", config: ":execute_commands,/.roku_config.json"}
311
316
  config = good_config
312
317
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
313
318
  navigator.expect(:screen, true, [configs[:screen_config]])
@@ -322,7 +327,7 @@ class ControllerCommandsTest < Minitest::Test
322
327
  logger = Logger.new("/dev/null")
323
328
  navigator = Minitest::Mock.new
324
329
 
325
- options = {screens: true, stage: 'production', config: ":execute_commands,/.roku_config.json"}
330
+ options = {screens: true, config: ":execute_commands,/.roku_config.json"}
326
331
  config = good_config
327
332
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
328
333
  navigator.expect(:screens, true)
@@ -337,7 +342,7 @@ class ControllerCommandsTest < Minitest::Test
337
342
  logger = Logger.new("/dev/null")
338
343
  navigator = Minitest::Mock.new
339
344
 
340
- options = {text: "text string", stage: 'production', config: ":execute_commands,/.roku_config.json"}
345
+ options = {text: "text string", config: ":execute_commands,/.roku_config.json"}
341
346
  config = good_config
342
347
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
343
348
  navigator.expect(:type, true, [configs[:text_config]])
@@ -352,7 +357,7 @@ class ControllerCommandsTest < Minitest::Test
352
357
  logger = Logger.new("/dev/null")
353
358
  tester = Minitest::Mock.new
354
359
 
355
- options = {test: true, stage: 'production', config: "~/.roku_config.json"}
360
+ options = {test: true, config: "~/.roku_config.json"}
356
361
  config = good_config
357
362
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
358
363
  tester.expect(:run_tests, true, [configs[:test_config]])
@@ -367,7 +372,7 @@ class ControllerCommandsTest < Minitest::Test
367
372
  logger = Logger.new("/dev/null")
368
373
  inspector = Minitest::Mock.new
369
374
 
370
- options = {screencapture: true, stage: 'production', out: "/tmp/capture.jpg", config: "~/.roku_config.json"}
375
+ options = {screencapture: true, out: "/tmp/capture.jpg", config: "~/.roku_config.json"}
371
376
  config = good_config
372
377
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
373
378
  inspector.expect(:screencapture, true, [configs[:screencapture_config]])
@@ -382,7 +387,7 @@ class ControllerCommandsTest < Minitest::Test
382
387
  logger = Logger.new("/dev/null")
383
388
  inspector = Minitest::Mock.new
384
389
 
385
- options = {screencapture: true, stage: 'production', out: "/tmp", config: "~/.roku_config.json"}
390
+ options = {screencapture: true, out: "/tmp", config: "~/.roku_config.json"}
386
391
  config = good_config
387
392
  code, configs = RokuBuilder::ConfigParser.parse_config(options: options, config: config, logger: logger)
388
393
  inspector.expect(:screencapture, false, [configs[:screencapture_config]])
@@ -397,7 +402,7 @@ class ControllerCommandsTest < Minitest::Test
397
402
  logger = Logger.new("/dev/null")
398
403
  stager = Minitest::Mock.new
399
404
 
400
- options = {print: 'title', stage: 'production', config: "~/.roku_config.json"}
405
+ options = {print: 'title', config: "~/.roku_config.json"}
401
406
  config = good_config
402
407
  configs = {stage_config: {}}
403
408
  code = nil
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.8.1
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -338,7 +338,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
338
338
  requirements:
339
339
  - - "~>"
340
340
  - !ruby/object:Gem::Version
341
- version: 2.2.3
341
+ version: 2.2.4
342
342
  required_rubygems_version: !ruby/object:Gem::Requirement
343
343
  requirements:
344
344
  - - ">="