Class: RokuBuilder::ConfigValidator
- Inherits:
-
Object
- Object
- RokuBuilder::ConfigValidator
- Defined in:
- lib/roku_builder/config_validator.rb
Constant Summary collapse
- VALID_CONFIG =
0- MISSING_DEVICES =
1- MISSING_DEVICES_DEFAULT =
2- DEVICE_DEFAULT_BAD =
3- MISSING_PROJECTS_DEFAULT =
4
5- PROJECTS_DEFAULT_BAD =
6- DEVICE_MISSING_IP =
7- DEVICE_MISSING_USER =
8- DEVICE_MISSING_PASSWORD =
9- PROJECT_MISSING_APP_NAME =
10- PROJECT_MISSING_DIRECTORY =
11- PROJECT_MISSING_FOLDERS =
12- PROJECT_FOLDERS_BAD =
13- PROJECT_MISSING_FILES =
14- PROJECT_FILES_BAD =
15- STAGE_MISSING_BRANCH =
16- STAGE_MISSING_SCRIPT =
17- PROJECT_STAGE_METHOD_BAD =
18- KEY_MISSING_PATH =
19- KEY_MISSING_PASSWORD =
20- INVALID_MAPPING_INFO =
21- MISSING_KEY =
22- MISSING_STAGE_METHOD =
23
Instance Method Summary collapse
-
#initialize(config:) ⇒ ConfigValidator
constructor
A new instance of ConfigValidator.
- #is_depricated? ⇒ Boolean
- #is_fatal? ⇒ Boolean
- #is_valid? ⇒ Boolean
- #print_errors ⇒ Object
Constructor Details
#initialize(config:) ⇒ ConfigValidator
Returns a new instance of ConfigValidator.
31 32 33 34 35 |
# File 'lib/roku_builder/config_validator.rb', line 31 def initialize(config:) @logger = Logger.instance @config = config validate_config end |
Instance Method Details
#is_depricated? ⇒ Boolean
52 53 54 |
# File 'lib/roku_builder/config_validator.rb', line 52 def is_depricated? !@codes.select{|code| code < 0}.empty? end |
#is_fatal? ⇒ Boolean
48 49 50 |
# File 'lib/roku_builder/config_validator.rb', line 48 def is_fatal? !@codes.select{|code| code > 0}.empty? end |
#is_valid? ⇒ Boolean
56 57 58 |
# File 'lib/roku_builder/config_validator.rb', line 56 def is_valid? @codes.select{|code| code > 0}.empty? end |
#print_errors ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/roku_builder/config_validator.rb', line 37 def print_errors @codes.each do |code| if code > 0 @logger.fatal error_codes[code] end if code < 0 @logger.warn error_codes[code] end end end |