Sha256: db0490108a5bb2d164dd1a2378281dc656595c9071cf42167d67960965a1f530

Contents?: true

Size: 334 Bytes

Versions: 2

Compression:

Stored size: 334 Bytes

Contents

class Dir
  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

class String
  def to_hex_s
    unpack("H*").first
  end
  def from_hex_s
    [self].pack("H*")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sinatra-s3-0.99 lib/sinatra-s3/ext.rb
sinatra-s3-0.98 lib/sinatra-s3/ext.rb