module Dronejob::Modules::Workspace

Public Instance Methods

asset_dir(path) click to toggle source
# File lib/dronejob/modules/workspace.rb, line 59
def asset_dir(path)
  ::Workspace::Dir.new(File.join(Dir.pwd, "app/assets")).dir(path)
end
asset_file(path) click to toggle source
# File lib/dronejob/modules/workspace.rb, line 55
def asset_file(path)
  ::Workspace::Dir.new(File.join(Dir.pwd, "app/assets")).file(path)
end
cleanup_on_complete(value = true) click to toggle source
# File lib/dronejob/modules/workspace.rb, line 13
def cleanup_on_complete(value = true)
  @cleanup_on_complete = value
end
cleanup_on_complete?() click to toggle source
# File lib/dronejob/modules/workspace.rb, line 17
def cleanup_on_complete?
  !!@cleanup_on_complete
end
cleanup_on_error(value = true) click to toggle source
# File lib/dronejob/modules/workspace.rb, line 21
def cleanup_on_error(value = true)
  @cleanup_on_error = value
end
cleanup_on_error?() click to toggle source
# File lib/dronejob/modules/workspace.rb, line 25
def cleanup_on_error?
  !!@cleanup_on_error
end
delete_working_dir() click to toggle source
# File lib/dronejob/modules/workspace.rb, line 51
def delete_working_dir
  working_dir.delete if self.class.cleanup_on_complete? && @working_dir
end
dir(path) click to toggle source
# File lib/dronejob/modules/workspace.rb, line 39
def dir(path)
  working_dir.dir(path)
end
file(path) { |f| ... } click to toggle source
# File lib/dronejob/modules/workspace.rb, line 30
def file(path, &block)
  f = working_dir.file(path)
  unless block.nil?
    yield(f)
    f.write
  end
  f
end
working_dir() click to toggle source
# File lib/dronejob/modules/workspace.rb, line 43
def working_dir
  unless @working_dir
    @working_dir = ::Workspace::Dir.new(File.join(Dir.pwd, self.class.output_path, uuid))
    @working_dir.create
  end
  @working_dir
end