Sha256: a693449613cbd3a3ca06027d2abe4fafacdd21ad1043dcab23bc53ff9eb90d12

Contents?: true

Size: 450 Bytes

Versions: 28

Compression:

Stored size: 450 Bytes

Contents

require 'pathname'

class Pathname

  # Already included in 1.8.4+ version of Ruby
  if ! instance_methods.include?(:descend)

    # Calls the _block_ for every successive subdirectory of the
    # directory path from the root (absolute path) unitl +.+
    # (relative path) is reached.
    def descend()
      @path.scan(%r{[^/]*/?})[0...-1].inject('') do |path, dir|
        yield Pathname.new(path << dir)
      path
      end
    end

  end

end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
facets-0.9.0 lib/nano/pathname/descend.rb
facets-1.0.3 packages/core/lib/facet/pathname/descend.rb
facets-1.0.0 lib/facet/pathname/descend.rb
facets-1.3.0 lib/facets/core/pathname/descend.rb
facets-1.1.0 lib/facet/pathname/descend.rb
facets-1.2.0 lib/facets/core/pathname/descend.rb
facets-1.2.1 lib/facets/core/pathname/descend.rb
facets-1.3.2 lib/facets/core/pathname/descend.rb
facets-1.3.3 lib/facets/core/pathname/descend.rb
facets-1.3.1 lib/facets/core/pathname/descend.rb
facets-1.4.2 lib/facets/core/pathname/descend.rb
facets-1.4.0 lib/facets/core/pathname/descend.rb
facets-1.4.1 lib/facets/core/pathname/descend.rb
facets-1.4.3 lib/facets/core/pathname/descend.rb
facets-1.4.5 lib/facets/core/pathname/descend.rb
facets-1.4.4 lib/facets/core/pathname/descend.rb
facets-1.7.0 lib/facets/core/pathname/descend.rb
facets-1.7.38 lib/facets/core/pathname/descend.rb
facets-1.7.30 lib/facets/core/pathname/descend.rb
facets-1.7.46 lib/facets/core/pathname/descend.rb