Method: Hanami::Utils::Files.mkdir

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

.mkdir(path) ⇒ Object

Creates a directory for the given path. It assumes that all the tokens in ‘path` are meant to be a directory. All the intermediate directories are created.

Examples:

require "hanami/utils/files"

Hanami::Utils::Files.mkdir("path/to/directory")
  # => creates the `path/to/directory` directory

# WRONG this isn't probably what you want, check `.mkdir_p`
Hanami::Utils::Files.mkdir("path/to/file.rb")
  # => creates the `path/to/file.rb` directory

Parameters:

  • path (String, Pathname)

    the path to directory

See Also:

Since:

  • 1.1.0

[View source]

69
70
71
# File 'lib/hanami/utils/files.rb', line 69

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