Method: Hanami::Utils::Files.cp

Defined in:
lib/hanami/utils/files.rb

.cp(source, destination) ⇒ Object

Copies source into destination. All the intermediate directories are created. If the destination already exists, it overrides the contents.

Parameters:

  • source (String, Pathname)

    the path to the source file

  • destination (String, Pathname)

    the path to the destination file

Since:

  • 1.1.0

[View source]

45
46
47
48
# File 'lib/hanami/utils/files.rb', line 45

def self.cp(source, destination)
  mkdir_p(destination)
  FileUtils.cp(source, destination)
end