class SoarEnvironment::EnvironmentValidator
Constants
- VALID_EXECUTION_ENVIRONMENTS
Public Instance Methods
validate(environment)
click to toggle source
# File lib/soar_environment/environment_validator.rb, line 5 def validate(environment) errors = [] errors << 'invalid service identifier' if (environment['IDENTIFIER'].nil?) or (environment['IDENTIFIER'].strip == "") errors << 'Missing execution environment indicator' if (environment['RACK_ENV'] == 'none') or (environment['RACK_ENV'].nil?) or (environment['RACK_ENV'].strip == "") errors << 'Invalid execution environment indicator' if not VALID_EXECUTION_ENVIRONMENTS.include?(environment['RACK_ENV']) errors end