Module: Forever

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

Defined Under Namespace

Modules: Every Classes: Base

Constant Summary collapse

VERSION =
"0.2.5"

Instance Method Summary collapse

Instance Method Details

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



16
17
18
19
20
21
# File 'lib/forever.rb', line 16

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