Class: Travish::EnvironmentParser

Inherits:
Object
  • Object
show all
Defined in:
lib/environment_parser.rb

Overview

Handles parsing the environment from a .travis.yml file and merging it with overrides from other source such as ENV

Constant Summary collapse

STRING_REG_EX =
/^(.+)="?(.+?)"?$/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, *args) ⇒ EnvironmentParser

Create a new instance of ‘EnvironmentParser`



11
12
13
14
15
16
# File 'lib/environment_parser.rb', line 11

def initialize(env, *args)
  @env = env
  @env = [@env] if @env.is_a? String
  @override_envs = args
  @override_envs ||= []
end

Instance Attribute Details

#environment_hashObject

The resulting environment hash after merging the environment from the travis file with the specified overrides. This method is lazy and calculates its result on the first call



22
23
24
# File 'lib/environment_parser.rb', line 22

def environment_hash
  @environment_hash
end