Module: Forever

Extended by:
Forever
Included in:
Forever
Defined in:
lib/forever.rb,
lib/forever/job.rb,
lib/forever/base.rb,
lib/forever/version.rb

Defined Under Namespace

Classes: Base, Job

Constant Summary collapse

VERSION =
"0.3.3"

Instance Method Summary collapse

Instance Method Details

#run(options = {}, &block) ⇒ Object



14
15
16
17
18
19
# File 'lib/forever.rb', line 14

def run(options={}, &block)
  caller_file = caller(1).map { |line| line.split(/:(?=\d|in )/)[0,1] }.flatten.first
  options[:file] ||= File.expand_path(caller_file)
  options[:dir]  ||= File.expand_path('../../', options[:file]) # => we presume we are calling it from a bin|script dir
  Base.new(options, &block)
end