Method: Pathname#make_dir

Defined in:
lib/pleasant_path/pathname.rb

#make_dirself

Creates the directory indicated by the Pathname, including any necessary parent directories. Returns the Pathname.

Examples:

Dir.exist?("path")                # == false
Dir.exist?("path/to")             # == false

Pathname.new("path/to").make_dir  # == Pathname.new("path/to")

Dir.exist?("path")                # == true
Dir.exist?("path/to")             # == true

Returns:

  • (self)

Raises:

  • (SystemCallError)

    if the Pathname points to an existing file (non-directory)

See Also:



291
292
293
294
# File 'lib/pleasant_path/pathname.rb', line 291

def make_dir
  self.mkpath
  self
end