class ProcessExecuter::Destinations::FilePath

@api private
Handles file path destinations

def self.handles?(destination)

Returns:
  • (Boolean) - true if destination is a String

Parameters:
  • destination (Object) -- the destination to check
def self.handles?(destination)
  destination.is_a? String
end

def close

Returns:
  • (void) -
def close
  file.close unless file.closed?
end

def initialize(destination)

Raises:
  • (Errno::ENOENT) - if the file path is invalid

Returns:
  • (FilePath) - a new file path destination handler

Parameters:
  • destination (String) -- the file path to write to
def initialize(destination)
  super
  @file = File.open(destination, 'w', 0o644)
end

def write(data)

Raises:
  • (IOError) - if the file is closed

Returns:
  • (Integer) - the number of bytes written

Parameters:
  • data (String) -- the data to write
def write(data)
  super
  file.write data
end