Sha256: 7a1fb0ad42e6aa2b113b77702ff144131daa54eb4b74bc0f2ac586b3d045cfdc

Contents?: true

Size: 268 Bytes

Versions: 33

Compression:

Stored size: 268 Bytes

Contents

class Dir
  # http://www.ruby-forum.com/topic/84762
  def empty?
    Dir.glob("#{ path }/*", File::FNM_DOTMATCH) do |e|
      return false unless %w( . .. ).include?(File::basename(e))
    end
    return true
  end
  def self.empty? path
    new(path).empty?
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
zena-1.2.8 lib/zena/core_ext/dir.rb
zena-1.2.7 lib/zena/core_ext/dir.rb
zena-1.2.6 lib/zena/core_ext/dir.rb
zena-1.2.5 lib/zena/core_ext/dir.rb
zena-1.2.4 lib/zena/core_ext/dir.rb
zena-1.2.3 lib/zena/core_ext/dir.rb
zena-1.2.2 lib/zena/core_ext/dir.rb
zena-1.2.1 lib/zena/core_ext/dir.rb
zena-1.2.0 lib/zena/core_ext/dir.rb
zena-1.1.3 lib/zena/core_ext/dir.rb
zena-1.1.2 lib/zena/core_ext/dir.rb
zena-1.1.1 lib/zena/core_ext/dir.rb
zena-1.1.0 lib/zena/core_ext/dir.rb
zena-1.0.0 lib/zena/core_ext/dir.rb
zena-1.0.0.rc3 lib/zena/core_ext/dir.rb
zena-1.0.0.rc2 lib/zena/core_ext/dir.rb
zena-1.0.0.rc1 lib/zena/core_ext/dir.rb
zena-0.16.9 lib/zena/core_ext/dir.rb
zena-1.0.0.beta3 lib/zena/core_ext/dir.rb
zena-0.16.8 lib/zena/core_ext/dir.rb