Class: LogicalConstruct::SatisfiableFileTask

Inherits:
SatisfiableTask show all
Defined in:
lib/logical-construct/satisfiable-task.rb

Instance Method Summary collapse

Methods inherited from SatisfiableTask

#execute, #needed?, #receive, #receive_file

Instance Method Details

#criteria(task) ⇒ Object



61
62
63
# File 'lib/logical-construct/satisfiable-task.rb', line 61

def criteria(task)
  File::exists?(target_path)
end

#fulfill(data) ⇒ Object



69
70
71
72
73
# File 'lib/logical-construct/satisfiable-task.rb', line 69

def fulfill(data)
  File::open(target_path, "w") do |file|
    file.write(data)
  end
end

#fulfill_file(file) ⇒ Object



65
66
67
# File 'lib/logical-construct/satisfiable-task.rb', line 65

def fulfill_file(file)
  FileUtils::move(file.path, target_path)
end

#prefer_file?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/logical-construct/satisfiable-task.rb', line 57

def prefer_file?
  true
end