Module: Pathname::Extensions::Explode
- Defined in:
- lib/pathname/extensions/explode.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#explode ⇒ Array<Pathname>
Explode a path into individual components.
Class Method Details
.included(host) ⇒ Object
8 9 10 11 |
# File 'lib/pathname/extensions/explode.rb', line 8 def self.included(host) super host.load_extensions :constants end |
Instance Method Details
#explode ⇒ Array<Pathname>
Explode a path into individual components
18 19 20 21 22 23 24 |
# 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 |