Method: Hanami::Utils::Files.touch

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

.touch(path) ⇒ Object

Creates an empty file for the given path. All the intermediate directories are created. If the path already exists, it doesn’t change the contents

Parameters:

  • path (String, Pathname)

    the path to file

Since:

  • 1.1.0

[View source]

20
21
22
23
# File 'lib/hanami/utils/files.rb', line 20

def self.touch(path)
  mkdir_p(path)
  FileUtils.touch(path)
end