Class: DataPipe2::Host
- Inherits:
-
Object
- Object
- DataPipe2::Host
- Defined in:
- lib/host.rb
Overview
Host
Instance Method Summary collapse
Instance Method Details
#long_run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# 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 ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 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 ⇒ Object
36 37 38 39 40 41 42 |
# 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 |