Sha256: d752aba0613917c0e2918f2e93da1326d7f99f39cd3ecc6fe07c435a0504551a

Contents?: true

Size: 455 Bytes

Versions: 6

Compression:

Stored size: 455 Bytes

Contents

class Dir
  Backports::EXCLUDED_CHILDREN = ['.', '..'].freeze unless Backports.const_defined?('EXCLUDED_CHILDREN')
  def self.each_child(*args)
    return to_enum(__method__, *args) unless block_given?
    foreach(*args) { |f| yield f unless Backports::EXCLUDED_CHILDREN.include? f }
  end

  def each_child(&block)
    return to_enum(__method__) unless block_given?

    Dir.each_child(path, &block)
    self
  end
end unless Dir.respond_to? :each_child

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
backports-3.25.0 lib/backports/2.5.0/dir/each_child.rb
backports-3.24.1 lib/backports/2.5.0/dir/each_child.rb
backports-3.24.0 lib/backports/2.5.0/dir/each_child.rb
backports-3.23.0 lib/backports/2.5.0/dir/each_child.rb
backports-3.22.1 lib/backports/2.5.0/dir/each_child.rb
backports-3.22.0 lib/backports/2.5.0/dir/each_child.rb