class DataPipe2::Host

Host

Public Instance Methods

long_run() click to toggle source
# File lib/host.rb, line 23
def long_run
  Kernel.loop do
    begin
      single_run

      sleep 0.5
    rescue SystemExit, Interrupt
      puts 'Exiting on request ...'
      break
    end
  end
end
run() click to toggle source
# File lib/host.rb, line 8
def run
  libs = ENV['LIB'] ||= './lib'
  libs.split(';').each do |path|
    DataPipe2.log "Adding libdir: #{path}"
    $LOAD_PATH.unshift path
  end

  @dsl_paths = ENV['DSL'] ||= './dsl'
  DataPipe2.log "dsl_paths: #{@dsl_paths}"
  @hash = {}

  @hash['jobs'] = Jobs.new
  long_run
end
single_run() click to toggle source
# File lib/host.rb, line 36
def single_run
  @dsl_paths.split(';').each do |dsl_dir|
    Dir.glob("#{dsl_dir}/*.dsl").each do |dsl_path|
      @hash['jobs'].call dsl_path
    end
  end
end