Sha256: 1b4a66c24bdcaffe4795cf1663fe7b561e6a7da9e4b3775af3104f8fc1aceb25

Contents?: true

Size: 530 Bytes

Versions: 55

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

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

55 entries across 55 versions & 1 rubygems

Version Path
nanoc-4.11.14 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.13 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.12 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.11 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.10 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.9 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.8 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.7 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.6 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.5 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.11.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.10.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.10.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.10.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.10.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-4.10.0 lib/nanoc/extra/core_ext/pathname.rb