Sha256: 2c11da5c62a2602bd0bd36b1ff7da220304fbffd7ef44a8c859ebb10bca35c2c

Contents?: true

Size: 472 Bytes

Versions: 23

Compression:

Stored size: 472 Bytes

Contents

# encoding: utf-8

module Nanoc::Extra

  module PathnameExtensions

    def 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 include_component?(component)
      self.components.include?(component)
    end

  end

end

class ::Pathname
  include ::Nanoc::Extra::PathnameExtensions
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
nanoc-3.6.7 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.6 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.5 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.6.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.5.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.5.0b2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.5.0b1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.4.3 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.4.2 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.4.1 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.4.0 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.3.7 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.3.6 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.3.5 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.3.4 lib/nanoc/extra/core_ext/pathname.rb
nanoc-3.3.3 lib/nanoc/extra/core_ext/pathname.rb