Method: OFlow::Actors::Recorder#initialize
- Defined in:
- lib/oflow/actors/recorder.rb
#initialize(task, options) ⇒ Recorder
Initializes the recorder with options of:
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/oflow/actors/recorder.rb', line 19 def initialize(task, ) super @cache = {} @dir = [:dir] if @dir.nil? @dir = File.join('db', task.full_name.gsub(':', '/')) end @dir = File.(@dir.strip) @results_path = [:results_path] @results_path.strip! unless @results_path.nil? if Dir.exist?(@dir) Dir.glob(File.join(@dir, '*.json')).each do |path| load(path) end else `mkdir -p #{@dir}` end end |