Sha256: eae503943760cb9063e2617ad6660256bafeb63ec2b13337830caa677e533f22

Contents?: true

Size: 944 Bytes

Versions: 2

Compression:

Stored size: 944 Bytes

Contents

module Larrow::Runner
  module Manifest
    class Larrow < BaseLoader
      def config_file
        source_accessor.larrow_file || '.larrow.yml'
      end
  
      # TODO manifest validation
      def parse content
        data = YAML.load(content).with_indifferent_access
        if data.is_a? Array # stages as a Array
          # TODO
        elsif data.is_a? Hash # steps as a Hash
          configuration.image = data[:image]
          Configuration::DEFINED_GROUPS[:custom].each do |title|
            v = data[title]
            build_step title,v if v
          end
        end
      end
  
      def build_step title, lines
        source_dir = if title == :init
                       nil
                     else
                       configuration.source_dir
                     end
        scripts = lines.map{|s| Script.new s, base_dir: source_dir}
        configuration.put_to_step title, scripts
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
larrow-runner-0.0.3 lib/larrow/runner/manifest/adapter/larrow.rb
larrow-runner-0.0.2 lib/larrow/runner/manifest/adapter/larrow.rb