Class: Incline::WorkPath

Inherits:
Object
  • Object
show all
Defined in:
lib/incline/work_path.rb

Overview

This class simply locates a temporary working directory for the application.

By default we shoot for shared memory such as /run/shm or /dev/shm. If those fail, we look to /tmp.

Class Method Summary collapse

Class Method Details

.locationObject

Gets the temporary working directory location for the application.



13
14
15
# File 'lib/incline/work_path.rb', line 13

def self.location
  @location ||= get_location
end

.path_for(filename) ⇒ Object

Gets a path for a specific temporary file.



20
21
22
# File 'lib/incline/work_path.rb', line 20

def self.path_for(filename)
  location + '/' + filename
end

.system_status_fileObject

Gets the path to the system status file.

This file is used by long running processes to log their progress.



29
30
31
# File 'lib/incline/work_path.rb', line 29

def self.system_status_file
  @system_status_file ||= path_for('system_status')
end