Sha256: d38e0136921c581ecd12906f35f22ee6992b16cb92a0ad24519dd5bc3f622c6c

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

require "hitcher/version"

require_relative 'hitcher/dsl'
require_relative 'hitcher/run_ops'

module Hitcher
  class Error < StandardError; end
  # Your code goes here...

  CONF_PATH = File.join(Dir.home,".hitcher","hitcher_conf.yml")

  class Cli
    include Hitcher::Dsl
    include Hitcher::CliOps::RunOps

    # DSL start here!
    def parse(spec)
      if File.exist?(spec)
        File.open(spec,"r") do |f|
          @cont = f.read
        end

        begin
          @inst = start(@cont.strip.lines)
          @inst
        rescue Exception => ex
          Hitcher::Global.instance.glog.error ex.message
          Hitcher::Global.instance.glog.error ex.backtrace.join("\n")
          raise ex
        end
        #logger.debug "instance_eval after parse"

      else
        raise Error, "Given spec file '#{spec}' does not exist"
      end
    end # parse

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Hitcher-0.1.0 lib/hitcher.rb