roku_builder 3.6.2 → 3.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Gemfile.lock +1 -1
  4. data/Guardfile +2 -0
  5. data/LICENSE.txt +10 -18
  6. data/README.md +4 -0
  7. data/bin/roku +1 -0
  8. data/lib/roku_builder.rb +10 -1
  9. data/lib/roku_builder/config_manager.rb +11 -0
  10. data/lib/roku_builder/config_parser.rb +3 -1
  11. data/lib/roku_builder/config_validator.rb +67 -45
  12. data/lib/roku_builder/controller.rb +2 -0
  13. data/lib/roku_builder/controller_commands.rb +4 -2
  14. data/lib/roku_builder/error_handler.rb +2 -0
  15. data/lib/roku_builder/inspector.rb +2 -0
  16. data/lib/roku_builder/keyer.rb +2 -0
  17. data/lib/roku_builder/linker.rb +2 -0
  18. data/lib/roku_builder/loader.rb +2 -0
  19. data/lib/roku_builder/manifest_manager.rb +2 -0
  20. data/lib/roku_builder/monitor.rb +2 -0
  21. data/lib/roku_builder/navigator.rb +2 -0
  22. data/lib/roku_builder/packager.rb +2 -0
  23. data/lib/roku_builder/stager.rb +2 -0
  24. data/lib/roku_builder/tester.rb +2 -0
  25. data/lib/roku_builder/util.rb +2 -0
  26. data/lib/roku_builder/version.rb +3 -1
  27. data/rakefile +2 -0
  28. data/tests/roku_builder/config_manager_test.rb +17 -0
  29. data/tests/roku_builder/config_parser_test.rb +4 -2
  30. data/tests/roku_builder/config_validator_test.rb +2 -0
  31. data/tests/roku_builder/controller_commands_test.rb +2 -0
  32. data/tests/roku_builder/controller_test.rb +2 -0
  33. data/tests/roku_builder/error_handler_test.rb +2 -0
  34. data/tests/roku_builder/inspector_test.rb +2 -0
  35. data/tests/roku_builder/keyer_test.rb +2 -0
  36. data/tests/roku_builder/linker_test.rb +2 -0
  37. data/tests/roku_builder/loader_test.rb +2 -0
  38. data/tests/roku_builder/manifest_manager_test.rb +2 -0
  39. data/tests/roku_builder/monitor_test.rb +2 -0
  40. data/tests/roku_builder/navigator_test.rb +2 -0
  41. data/tests/roku_builder/packager_test.rb +2 -0
  42. data/tests/roku_builder/stager_test.rb +3 -2
  43. data/tests/roku_builder/test_files/controller_test/parent_config.json +34 -0
  44. data/tests/roku_builder/test_helper.rb +2 -0
  45. data/tests/roku_builder/tester_test.rb +3 -1
  46. data/tests/roku_builder/util_test.rb +2 -0
  47. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cda87c8c79464c6cbaadc76552d553d1d4f992f8
4
- data.tar.gz: b2f72f1595cb30bc54ba7fabde915ff1f5761454
3
+ metadata.gz: e7f742dbc20bf1b9b2c0d4630766b4cfe8331bcc
4
+ data.tar.gz: 0cc26f2c74cefc294825774d4224350bb776d9ad
5
5
  SHA512:
6
- metadata.gz: f4bc039de589e530c0424df8067bc0985d54ce37ef356cd212a7d668a4934391ca41490d83d5af0710b291edf7a274b7a7787fb080275b43350a47cdacf7e5a8
7
- data.tar.gz: f7470fa07bb4bb460ffc011d71a58bc278414674b0718b286cc4b1844a9f93bee3a441dc00912cef2aa3fec905be71258eb4ed72da065f9d04924574fe1dee09
6
+ metadata.gz: 6fa6683a5282913bfe575478f4bf944585890def77ef21dd76ec52e3bbcf0d89294a3cb749728f9ccbd5352d5d01aa6b279c06c5b7b5a9b34df4a84b4ec230b4
7
+ data.tar.gz: 07a18218d5a80791d8af63f529255db433379fa85b0ab1e3dc92eb03c64ec85979f690fad382e17d4d0b7a13aefd693c6c11efa5a9d5aee6259787e1570cf054
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in roku_builder.gemspec
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roku_builder (3.6.2)
4
+ roku_builder (3.6.3)
5
5
  faraday (~> 0.9)
6
6
  faraday-digestauth (~> 0.2)
7
7
  git (~> 1.3)
data/Guardfile CHANGED
@@ -1,3 +1,5 @@
1
+ # ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********
2
+
1
3
  # A sample Guardfile
2
4
  # More info at https://github.com/guard/guard#readme
3
5
 
@@ -1,22 +1,14 @@
1
- Copyright (c) 2016 Viacom Inc.
1
+ Copyright 2016 Viacom, Inc.
2
2
 
3
- MIT License
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
4
6
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
7
+ http://www.apache.org/licenses/LICENSE-2.0
12
8
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -312,3 +312,7 @@ directory:
312
312
  3. Commit your changes (`git commit -am 'Add some feature'`)
313
313
  4. Push to the branch (`git push origin feature/my-new-feature`)
314
314
  5. Create a new Pull Request
315
+
316
+ ## License
317
+
318
+ On June 1st, 2016, we switched this project from the MIT License to Apache 2.0
data/bin/roku CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
 
@@ -1,3 +1,5 @@
1
+ # ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require "logger"
2
4
  require "faraday"
3
5
  require "faraday/digestauth"
@@ -134,7 +136,7 @@ module RokuBuilder
134
136
  IDENTICAL_SIDELOAD = 13
135
137
  end
136
138
 
137
- class String
139
+ class ::String
138
140
  def underscore
139
141
  word = self.dup
140
142
  word.gsub!(/::/, '/')
@@ -145,3 +147,10 @@ class String
145
147
  word
146
148
  end
147
149
  end
150
+
151
+ class ::Hash
152
+ def deep_merge(second)
153
+ merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
154
+ self.merge(second, &merger)
155
+ end
156
+ end
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Load and validate config files.
@@ -53,6 +55,15 @@ module RokuBuilder
53
55
  value[:stage_method] = value[:stage_method].to_sym
54
56
  end
55
57
  end
58
+ config[:projects].each_pair do |key, value|
59
+ unless key == :default
60
+ if value[:parent] and config[:projects][value[:parent].to_sym]
61
+ new_value = config[:projects][value[:parent].to_sym]
62
+ new_value = new_value.deep_merge value
63
+ config[:projects][key] = new_value
64
+ end
65
+ end
66
+ end
56
67
  config
57
68
  rescue JSON::ParserError
58
69
  logger.fatal "Config file is not valid JSON"
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Contains methods that will parse the loaded config and generate
@@ -27,7 +29,7 @@ module RokuBuilder
27
29
  project_config = setup_project_config(config: config, options: options)
28
30
  return [project_config, nil, nil] unless project_config.class == Hash
29
31
  configs[:project_config] = project_config
30
- stage_config, stage = setup_stage_config(configs: configs, options: options, logger: logger)
32
+ stage = setup_stage_config(configs: configs, options: options, logger: logger)[1]
31
33
  return [UNKNOWN_STAGE, nil, nil] unless stage
32
34
  setup_sideload_config(configs: configs, options: options)
33
35
  setup_package_config(configs: configs, options: options, stage: stage)
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  MISSING_DEVICES = 1
@@ -30,18 +32,22 @@ module RokuBuilder
30
32
  # @return [Array] error codes for valid config (see self.error_codes)
31
33
  def self.validate_config(config:)
32
34
  codes = []
33
- validate_device_structure(codes: codes, config: config)
34
- validate_project_structure(codes: codes, config: config)
35
+ validate_structure(codes: codes, config: config)
35
36
  if config[:devices]
36
- config[:devices].each {|k,v|
37
- next if k == :default
38
- validate_device(codes: codes, device: v)
37
+ config[:devices].each {|device, device_config|
38
+ next if device == :default
39
+ validate_device(codes: codes, device: device_config)
39
40
  }
40
41
  end
41
42
  if config[:projects]
42
- config[:projects].each {|project,v|
43
+ config[:projects].each {|project,project_config|
43
44
  next if project == :default
44
- validate_project(codes: codes, project: v)
45
+ validate_project(codes: codes, project: project_config)
46
+ if project_config[:stages]
47
+ project_config[:stages].each {|_stage, stage_config|
48
+ validate_stage(codes: codes, stage: stage_config, project: project_config)
49
+ }
50
+ end
45
51
  }
46
52
  end
47
53
  codes.uniq!
@@ -78,40 +84,39 @@ module RokuBuilder
78
84
  ]
79
85
  end
80
86
 
81
- # Validates the roku config config structure
82
- # @param codes [Array] array of error codes
83
- # @param config [Hash] roku config object
84
- def self.validate_device_structure(codes:, config:)
85
- codes.push(MISSING_DEVICES) if not config[:devices]
86
- codes.push(MISSING_DEVICES_DEFAULT) if config[:devices] and not config[:devices][:default]
87
- codes.push(DEVICE_DEFAULT_BAD) if config[:devices] and config[:devices][:default] and not config[:devices][:default].is_a?(Symbol)
88
- end
89
- private_class_method :validate_device_structure
90
-
91
- # Validates the roku config project structure
87
+ # Validates the roku config structure
92
88
  # @param codes [Array] array of error codes
93
89
  # @param config [Hash] roku config object
94
- def self.validate_project_structure(codes:, config:)
95
- codes.push(MISSING_PROJECTS) if not config[:projects]
96
- codes.push(MISSING_PROJECTS_DEFAULT) if config[:projects] and not config[:projects][:default]
97
- codes.push(MISSING_PROJECTS_DEFAULT) if config[:projects] and config[:projects][:default] == "<project id>".to_sym
98
- codes.push(PROJECTS_DEFAULT_BAD) if config[:projects] and config[:projects][:default] and not config[:projects][:default].is_a?(Symbol)
90
+ def self.validate_structure(codes:, config:)
91
+ errors = [
92
+ [MISSING_DEVICES, !config[:devices]],
93
+ [MISSING_DEVICES_DEFAULT, (config[:devices] and !config[:devices][:default])],
94
+ [DEVICE_DEFAULT_BAD, (config[:devices] and config[:devices][:default] and !config[:devices][:default].is_a?(Symbol))],
95
+ [MISSING_PROJECTS, (!config[:projects])],
96
+ [MISSING_PROJECTS_DEFAULT, (config[:projects] and !config[:projects][:default])],
97
+ [MISSING_PROJECTS_DEFAULT, (config[:projects] and config[:projects][:default] == "<project id>".to_sym)],
98
+ [PROJECTS_DEFAULT_BAD, (config[:projects] and config[:projects][:default] and !config[:projects][:default].is_a?(Symbol))]
99
+ ]
100
+ process_errors(codes: codes, errors: errors)
99
101
  end
100
- private_class_method :validate_project_structure
102
+ private_class_method :validate_structure
101
103
 
102
104
  # Validates a roku config device
103
105
  # @param codes [Array] array of error codes
104
106
  # @param device [Hash] device config object
105
107
  def self.validate_device(codes:, device:)
106
- codes.push(DEVICE_MISSING_IP) if not device[:ip]
107
- codes.push(DEVICE_MISSING_IP) if device[:ip] == "xxx.xxx.xxx.xxx"
108
- codes.push(DEVICE_MISSING_IP) if device[:ip] == ""
109
- codes.push(DEVICE_MISSING_USER) if not device[:user]
110
- codes.push(DEVICE_MISSING_USER) if device[:user] == "<username>"
111
- codes.push(DEVICE_MISSING_USER) if device[:user] == ""
112
- codes.push(DEVICE_MISSING_PASSWORD) if not device[:password]
113
- codes.push(DEVICE_MISSING_PASSWORD) if device[:password] == "<password>"
114
- codes.push(DEVICE_MISSING_PASSWORD) if device[:password] == ""
108
+ errors = [
109
+ [DEVICE_MISSING_IP, (!device[:ip])],
110
+ [DEVICE_MISSING_IP, (device[:ip] == "xxx.xxx.xxx.xxx")],
111
+ [DEVICE_MISSING_IP, (device[:ip] == "")],
112
+ [DEVICE_MISSING_USER, (!device[:user])],
113
+ [DEVICE_MISSING_USER, (device[:user] == "<username>")],
114
+ [DEVICE_MISSING_USER, (device[:user] == "")],
115
+ [DEVICE_MISSING_PASSWORD, (!device[:password])],
116
+ [DEVICE_MISSING_PASSWORD, (device[:password] == "<password>")],
117
+ [DEVICE_MISSING_PASSWORD, (device[:password] == "")]
118
+ ]
119
+ process_errors(codes: codes, errors: errors)
115
120
  end
116
121
  private_class_method :validate_device
117
122
 
@@ -119,19 +124,36 @@ module RokuBuilder
119
124
  # @param codes [Array] array of error codes
120
125
  # @param project [Hash] project config object
121
126
  def self.validate_project(codes:, project:)
122
- codes.push(PROJECT_MISSING_APP_NAME) if not project[:app_name]
123
- codes.push(PROJECT_MISSING_DIRECTORY) if not project[:directory]
124
- codes.push(PROJECT_MISSING_FOLDERS) if not project[:folders]
125
- codes.push(PROJECT_FOLDERS_BAD) if project[:folders] and not project[:folders].is_a?(Array)
126
- codes.push(PROJECT_MISSING_FILES) if not project[:files]
127
- codes.push(PROJECT_FILES_BAD) if project[:files] and not project[:files].is_a?(Array)
128
- codes.push(MISSING_STAGE_METHOD) unless project[:stage_method]
129
- codes.push(PROJECT_STAGE_METHOD_BAD) unless [:git, :script, nil].include?(project[:stage_method])
130
- project[:stages].each {|_stage,value|
131
- codes.push(STAGE_MISSING_BRANCH) if not value[:branch] and project[:stage_method] == :git
132
- codes.push(STAGE_MISSING_SCRIPT) if not value[:script] and project[:stage_method] == :script
133
- }
127
+ errors= [
128
+ [PROJECT_MISSING_APP_NAME, (!project[:app_name])],
129
+ [PROJECT_MISSING_DIRECTORY, (!project[:directory])],
130
+ [PROJECT_MISSING_FOLDERS, (!project[:folders])],
131
+ [PROJECT_FOLDERS_BAD, (project[:folders] and !project[:folders].is_a?(Array))],
132
+ [PROJECT_MISSING_FILES, (!project[:files])],
133
+ [PROJECT_FILES_BAD, (project[:files] and !project[:files].is_a?(Array))],
134
+ [MISSING_STAGE_METHOD, ( !project[:stage_method])],
135
+ [PROJECT_STAGE_METHOD_BAD, (![:git, :script, nil].include?(project[:stage_method]))]
136
+ ]
137
+ process_errors(codes: codes, errors: errors)
134
138
  end
135
139
  private_class_method :validate_project
140
+
141
+ # Validates a roku config project
142
+ # @param codes [Array] array of error codes
143
+ # @param project [Hash] project config object
144
+ def self.validate_stage(codes:, stage:, project:)
145
+ errors= [
146
+ [STAGE_MISSING_BRANCH, (!stage[:branch] and project[:stage_method] == :git)],
147
+ [STAGE_MISSING_SCRIPT, (!stage[:script] and project[:stage_method] == :script)],
148
+ ]
149
+ process_errors(codes: codes, errors: errors)
150
+ end
151
+ private_class_method :validate_stage
152
+
153
+ def self.process_errors(codes:, errors:)
154
+ errors.each do |error|
155
+ codes.push(error[0]) if error[1]
156
+ end
157
+ end
136
158
  end
137
159
  end
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Controls all interaction with other classes
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Commands that the controller uses to interface with the rest of the gem.
@@ -43,7 +45,7 @@ module RokuBuilder
43
45
  success = nil
44
46
  if stager.stage
45
47
  loader = Loader.new(**config)
46
- success, version = loader.sideload(**configs[:sideload_config])
48
+ success = loader.sideload(**configs[:sideload_config])[0]
47
49
  end
48
50
  stager.unstage
49
51
  unless success == FAILED_SIDELOAD
@@ -169,7 +171,7 @@ module RokuBuilder
169
171
  success = instance.send(method)
170
172
  end
171
173
  return failure unless failure.nil? or success
172
- logger.info ()
174
+ logger.info "#{klass} call #{method} successfully"
173
175
  SUCCESS
174
176
  end
175
177
  end
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Contains methods to handle errors from different sources.
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Collects information on a package for submission
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Change or get dev key
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Launch application, sending parameters
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Load/Unload/Build roku applications
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Updates or retrives build version
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Monitor development Logs
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Navigation methods
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Method of packaging app for submission
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Change stage of roku application
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Method for running unit tests
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
 
3
5
  # Super class for device utilities
@@ -1,4 +1,6 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  module RokuBuilder
2
4
  # Version of the RokuBuilder Gem
3
- VERSION = "3.6.2"
5
+ VERSION = "3.6.3"
4
6
  end
data/rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # ********** Copyright 2016 Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require 'rake'
2
4
  require 'rake/testtask'
3
5
 
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ConfigManagerTest < Minitest::Test
@@ -265,4 +267,19 @@ class ConfigManagerTest < Minitest::Test
265
267
  io.verify
266
268
  end
267
269
 
270
+ def test_config_manager_parent_config
271
+ logger = Logger.new("/dev/null")
272
+ target_config = File.join(File.dirname(__FILE__), "test_files", "controller_test", "configure_test.json")
273
+ File.delete(target_config) if File.exist?(target_config)
274
+ FileUtils.cp(File.join(File.dirname(target_config), "parent_config.json"), target_config)
275
+
276
+ options = {validate: true, config: target_config, stage: :production}
277
+ code, config, configs = RokuBuilder::ConfigManager.load_config(options: options, logger: logger)
278
+ assert_equal RokuBuilder::SUCCESS, code
279
+ assert_equal "app2", config[:projects][:p2][:app_name]
280
+ assert_equal "/dev/null", config[:projects][:p2][:directory]
281
+ assert_equal 2, config[:projects][:p2][:files].count
282
+ assert_equal 2, config[:projects][:p2][:folders].count
283
+ end
284
+
268
285
  end
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ConfigParserTest < Minitest::Test
@@ -38,7 +40,7 @@ class ConfigParserTest < Minitest::Test
38
40
  options: {stage: "production"},
39
41
  logger: Logger.new("/dev/null")
40
42
  }
41
- config, stage = RokuBuilder::ConfigParser.send(:setup_stage_config, **args)
43
+ config = RokuBuilder::ConfigParser.send(:setup_stage_config, **args)[0]
42
44
  assert_equal args[:configs][:project_config][:stages][:production][:script], config[:key]
43
45
  end
44
46
 
@@ -48,7 +50,7 @@ class ConfigParserTest < Minitest::Test
48
50
  options: {stage: "production", ref: "git-ref"},
49
51
  logger: Logger.new("/dev/null")
50
52
  }
51
- config, stage = RokuBuilder::ConfigParser.send(:setup_stage_config, **args)
53
+ config = RokuBuilder::ConfigParser.send(:setup_stage_config, **args)[0]
52
54
  assert_equal args[:options][:ref], config[:key]
53
55
  end
54
56
 
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ConfigValidatorTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ControllerCommandsTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ControllerTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class RokuBuilder::ErrorHandler
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class InspectorTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class KeyerTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class LinkerTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class LoaderTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class ManifestManagerTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class MonitorTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class NavigatorTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class PackagerTest < Minitest::Test
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class StagerTest < Minitest::Test
@@ -148,8 +150,6 @@ class StagerTest < Minitest::Test
148
150
  root_dir = File.join(File.dirname(__FILE__), "test_files", "stager_test")
149
151
  branch_name = 'branch'
150
152
  git = Minitest::Mock.new
151
- branch = Minitest::Mock.new
152
- stashes = Minitest::Mock.new
153
153
  logger = Minitest::Mock.new
154
154
 
155
155
  stager_config = {
@@ -170,6 +170,7 @@ class StagerTest < Minitest::Test
170
170
  stager.instance_variable_set(:@current_branch, "branch")
171
171
  assert !stager.unstage
172
172
  end
173
+ git.verify
173
174
  logger.verify
174
175
  end
175
176
 
@@ -0,0 +1,34 @@
1
+ {
2
+ "devices": {
3
+ "default": "roku",
4
+ "roku": {
5
+ "ip": "111.222.333.444",
6
+ "user": "user",
7
+ "password": "pass"
8
+ }
9
+ },
10
+ "projects": {
11
+ "default": "p1",
12
+ "p1": {
13
+ "directory": "/dev/null",
14
+ "folders": ["resources","source"],
15
+ "files": ["manifest"],
16
+ "app_name": "app",
17
+ "stage_method": "git",
18
+ "stages":{
19
+ "production": {
20
+ "branch": "master",
21
+ "key": {
22
+ "keyed_pkg": "/dev/null",
23
+ "password": "password"
24
+ }
25
+ }
26
+ }
27
+ },
28
+ "p2": {
29
+ "parent": "p1",
30
+ "app_name": "app2",
31
+ "files": ["manifest", "config.json"]
32
+ }
33
+ }
34
+ }
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require "simplecov"
2
4
  require "coveralls"
3
5
 
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class TesterTest < Minitest::Test
@@ -33,7 +35,7 @@ class TesterTest < Minitest::Test
33
35
 
34
36
  def test_tester_runtests_and_handle
35
37
  waitfor = Proc.new do |end_reg, &blk|
36
- assert_equal /\*\*\*\*\* ENDING TESTS \*\*\*\*\*/, end_reg
38
+ assert_equal(/\*\*\*\*\* ENDING TESTS \*\*\*\*\*/, end_reg)
37
39
  txt = "Fake Text"
38
40
  blk.call(txt) == false
39
41
  end
@@ -1,3 +1,5 @@
1
+ # ********** Copyright Viacom, Inc. Apache 2.0 **********
2
+
1
3
  require_relative "test_helper.rb"
2
4
 
3
5
  class UtilTest < Minitest::Test
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.6.2
4
+ version: 3.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - greeneca
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -290,6 +290,7 @@ files:
290
290
  - tests/roku_builder/stager_test.rb
291
291
  - tests/roku_builder/test_files/controller_config_test/valid_config.json
292
292
  - tests/roku_builder/test_files/controller_test/load_config_test.json
293
+ - tests/roku_builder/test_files/controller_test/parent_config.json
293
294
  - tests/roku_builder/test_files/controller_test/valid_config.json
294
295
  - tests/roku_builder/test_files/loader_test/a
295
296
  - tests/roku_builder/test_files/loader_test/manifest