Sha256: 279ea13a602288d9597d5b49bbf8e43838b73026a19cdbbaf8eb3f681fe0d4cf

Contents?: true

Size: 764 Bytes

Versions: 1

Compression:

Stored size: 764 Bytes

Contents

require 'gli'
require 'clenver'
require 'clenver/project'
require 'clenver/logging'

module Clenver
  class Runner
    include Logging

    def initialize(path, dst)
      @path = path
      @dst = dst
    end

    def start
      if File.exist?(@path)
        begin
          yaml = Psych.load_file("#{@path}")
          logger.debug("yaml: #{yaml}")
          #TODO: create test and fix this place with check for empty file
          p = Project.new(File.basename("#{@path}", ".yml"), yaml, @dst)
          p.create_repos
          p.init_project
        rescue Psych::SyntaxError => ex
          exit_now!("#{@path}: syntax error : #{ex.message}", 1)
        end
      else
        exit_now!("#{@path} no such file or directory", 2)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clenver-0.1.9 lib/clenver/runner.rb