Class: RokuBuilder::Controller
- Inherits:
-
Object
- Object
- RokuBuilder::Controller
- Defined in:
- lib/roku_builder/controller.rb
Overview
Controls all interaction with other classes
Class Method Summary collapse
-
.commands ⇒ Array<Symbol>
List of command options.
-
.depricated_options ⇒ Hash
List of depricated options.
-
.device_commands ⇒ Array<Symbol>
List of commands that require a device.
-
.exclude_commands ⇒ Array<Symbol] List of commands the will activate the exclude files lists
List of commands the activate the exclude files.
-
.run(options:) ⇒ Object
Run the builder.
-
.source_commands ⇒ Array<Symbol>
List of commands requiring a source option.
-
.sources ⇒ Array<Symbol>
List of source options.
-
.system(command:) ⇒ String
Run a system command.
Class Method Details
.commands ⇒ Array<Symbol>
List of command options
166 167 168 169 170 |
# File 'lib/roku_builder/controller.rb', line 166 def self.commands [:sideload, :package, :test, :deeplink,:configure, :validate, :delete, :navigate, :text, :build, :monitor, :update, :screencapture, :key, :screen, :screens, :applist, :print, :dostage, :dounstage] end |
.depricated_options ⇒ Hash
List of depricated options
174 175 176 |
# File 'lib/roku_builder/controller.rb', line 174 def self. {deeplink_depricated: "-L and --deeplink are depricated. Use -o -r --deeplink-options." } end |
.device_commands ⇒ Array<Symbol>
List of commands that require a device
198 199 200 201 |
# File 'lib/roku_builder/controller.rb', line 198 def self.device_commands [:sideload, :package, :test, :deeplink, :delete, :navigate, :text, :monitor, :screencapture, :applist, :print ] end |
.exclude_commands ⇒ Array<Symbol] List of commands the will activate the exclude files lists
List of commands the activate the exclude files
192 193 194 |
# File 'lib/roku_builder/controller.rb', line 192 def self.exclude_commands [:build, :package] end |
.run(options:) ⇒ Object
Run the builder
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/roku_builder/controller.rb', line 10 def self.run(options:) logger = Logger.new(STDOUT) logger.formatter = proc {|severity, datetime, _progname, msg| "[%s #%s] %5s: %s\n\r" % [datetime.strftime("%Y-%m-%d %H:%M:%S.%4N"), $$, severity, msg] } if [:debug] logger.level = Logger::DEBUG elsif [:verbose] logger.level = Logger::INFO else logger.level = Logger::WARN end # Validate Options = (options: ) ErrorHandler.(options_code: , options: , logger: logger) # Configure Gem configure_code = configure(options: , logger: logger) ErrorHandler.handle_configure_codes(configure_code: configure_code, logger: logger) # Load Config load_code, config, configs = ConfigManager.load_config(options: , logger: logger) ErrorHandler.handle_load_codes(options: , load_code: load_code, logger: logger) # Check devices device_code, configs = check_devices(options: , config: config, configs: configs, logger: logger) ErrorHandler.handle_device_codes(device_code: device_code, logger: logger) # Run Commands command_code = execute_commands(options: , config: config, configs: configs, logger: logger) ErrorHandler.handle_command_codes(command_code: command_code, logger: logger) end |
.source_commands ⇒ Array<Symbol>
List of commands requiring a source option
186 187 188 |
# File 'lib/roku_builder/controller.rb', line 186 def self.source_commands [:sideload, :package, :test, :build, :key] end |
.sources ⇒ Array<Symbol>
List of source options
180 181 182 |
# File 'lib/roku_builder/controller.rb', line 180 def self.sources [:ref, :set_stage, :working, :current, :in] end |
.system(command:) ⇒ String
Run a system command
232 233 234 |
# File 'lib/roku_builder/controller.rb', line 232 def self.system(command:) `#{command}`.chomp end |