Class: Larrow::Runner::Manifest::Travis

Inherits:
BaseLoader
  • Object
show all
Defined in:
lib/larrow/runner/manifest/adapter/travis.rb

Constant Summary collapse

CONFIG_FILE =
'.travis.yml'

Instance Attribute Summary collapse

Attributes inherited from BaseLoader

#configuration, #source_accessor

Instance Method Summary collapse

Methods inherited from BaseLoader

#config_file, #initialize, #load

Constructor Details

This class inherits a constructor from Larrow::Runner::Manifest::BaseLoader

Instance Attribute Details

#dataObject

Returns the value of attribute data.



7
8
9
# File 'lib/larrow/runner/manifest/adapter/travis.rb', line 7

def data
  @data
end

Instance Method Details

#build_languageObject



26
27
28
29
30
# File 'lib/larrow/runner/manifest/adapter/travis.rb', line 26

def build_language
  return if data[:language].nil?
  clazz = eval data[:language].capitalize
  clazz.fulfill(data,configuration)
end

#map_step(title, travis_title) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/larrow/runner/manifest/adapter/travis.rb', line 16

def map_step title, travis_title
  source_dir = configuration.source_dir
  scripts = (data[travis_title] || []).map do |cmd|
    Script.new cmd, base_dir: source_dir
  end
  return nil if scripts.empty?
  
  configuration.put_to_step title, scripts
end

#parse(content) ⇒ Object



9
10
11
12
13
14
# File 'lib/larrow/runner/manifest/adapter/travis.rb', line 9

def parse content
  self.data  = YAML.load(content).with_indifferent_access
  build_language
  map_step :prepare,         :before_script
  map_step :functional_test, :script
end