Module: Nanoc::Extra::PathnameExtensions Private

Included in:
Pathname
Defined in:
lib/nanoc/extra/core_ext/pathname.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#__nanoc_componentsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/nanoc/extra/core_ext/pathname.rb', line 4

def __nanoc_components
  components = []
  tmp = self
  loop do
    old = tmp
    components << File.basename(tmp)
    tmp = File.dirname(tmp)
    break if old == tmp
  end
  components.reverse
end

#__nanoc_include_component?(component) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


16
17
18
# File 'lib/nanoc/extra/core_ext/pathname.rb', line 16

def __nanoc_include_component?(component)
  __nanoc_components.include?(component)
end