Sha256: 073cd37cc0cca6e5b713769dcb35243238a35aeafc9f57f292939a0abc6eb70e

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

module Polyfill
  module V2_4
    module Dir
      module Class
        module EmptyQ
          module Method
            def empty?(path_name)
              exist?(path_name) && (entries(path_name) - ['.', '..']).empty?
            end
          end

          if RUBY_VERSION < '2.4.0'
            refine ::Dir.singleton_class do
              include Method
            end

            def self.included(base)
              base.include Method
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyfill-0.3.0 lib/polyfill/v2_4/dir/class/empty_q.rb