Sha256: e6b994b9f394ac1133e0f5b265247a9fa7f5254e0b9cd08ac3e163401611f97c

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 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

          refine ::Dir.singleton_class do
            include Method
          end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polyfill-0.6.0 lib/polyfill/v2_4/dir/class/empty_q.rb
polyfill-0.5.0 lib/polyfill/v2_4/dir/class/empty_q.rb
polyfill-0.4.0 lib/polyfill/v2_4/dir/class/empty_q.rb