Module: PEBuild::Transfer::File Private

Extended by:
Idempotent
Defined in:
lib/pe_build/transfer/file.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

TODO:

These methods fail in a messy way if something goes wrong. They should be refactored to raise proper errors.

Class Method Summary collapse

Methods included from Idempotent

idempotent

Class Method Details

.copy(src, dst) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • src (URI)

    The local file path path to the file to copy

  • dst (String)

    The path to destination of the copied file



12
13
14
# File 'lib/pe_build/transfer/file.rb', line 12

def self.copy(src, dst)
  idempotent(dst) { FileUtils.cp src.path, dst }
end

.read(src) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns The contents of the file with leading and trailing whitespace removed.

Parameters:

  • src (URI)

    The local file path path to the file to read

Returns:

  • (String)

    The contents of the file with leading and trailing whitespace removed.

Since:

  • 0.9.0



21
22
23
# File 'lib/pe_build/transfer/file.rb', line 21

def self.read(src)
  File.read(src.path).strip
end