Sha256: bd23b6580b626fadb18639079e38523fbcb15b70b6f91f62a13142a466fe453d

Contents?: true

Size: 499 Bytes

Versions: 62

Compression:

Stored size: 499 Bytes

Contents

module Nanoc::Extra
  # @api private
  module PathnameExtensions
    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

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

# @api private
class ::Pathname
  include ::Nanoc::Extra::PathnameExtensions
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
nanoc-4.7.9 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.8 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.7 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.6 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.5 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.7.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.6.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.6.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.6.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.6.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.6.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.5.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.5.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.5.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.5.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.5.0 lib/nanoc/extra/core_ext/pathname.rb