Method: Pathname#make_dirname

Defined in:
lib/pleasant_path/pathname.rb

#make_dirnameself

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

Examples:

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

Pathname.new("path/to/file").make_dirname  # == Pathname.new("path/to/file")

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

Returns:

  • (self)

Raises:

  • (SystemCallError)

    if any element of the dirname points to an existing file (non-directory)



313
314
315
316
# File 'lib/pleasant_path/pathname.rb', line 313

def make_dirname
  self.dirname.make_dir
  self
end