module Pathname::Extensions::Explode

Public Class Methods

included(host) click to toggle source
Calls superclass method
# File lib/pathname/extensions/explode.rb, line 8
def self.included(host)
  super
  host.load_extensions :constants
end

Public Instance Methods

explode() click to toggle source

Explode a path into individual components

@return [Array<Pathname>]

@see Pathmap#pathmap Used by `#pathmap`

# File lib/pathname/extensions/explode.rb, line 18
def explode
  head, tail = split
  return [self] if head == self
  return [tail] if head == HERE || tail == ROOT
  return [head, tail] if head == ROOT
  head.explode + [tail]
end