Sha256: 622050233251833262bda47a7f2aaa26931c43ddda9365f0510e258ea668b116

Contents?: true

Size: 397 Bytes

Versions: 13

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true

# This is a backport of ruby 2.5's each_child method
class FastIgnore
  module Backports
    module DirEachChild
      refine ::Dir.singleton_class do
        def each_child(path, &block)
          Dir.entries(path).each do |entry|
            next if entry == '.' || entry == '..'

            block.call entry
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fast_ignore-0.10.2 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.10.1 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.10.0 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.9.0 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.8.3 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.8.2 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.8.1 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.8.0 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.7.0 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.6.0 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.5.2 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.5.1 lib/fast_ignore/backports/dir_each_child.rb
fast_ignore-0.5.0 lib/fast_ignore/backports/dir_each_child.rb