Sha256: 97b4b7a9976d792c2a0c58ded5fcf2b4a9d3b709f7a3dfeb2b50f463680e4c47
Contents?: true
Size: 869 Bytes
Versions: 17
Compression:
Stored size: 869 Bytes
Contents
module Hobo module Lib module S3 module Local class IoHandler include Hobo::Logging def initialize path @path = path end def ls logger.debug("s3sync: Listing local directory: #{@path}") out = {} dir = "#{@path.chomp('/')}/" files = Dir.glob("#{dir}**/*") files.each do |file| out[file.gsub(/^#{dir}/, '')] = Digest::MD5.file(file).hexdigest end return out end def open file, mode file_path = ::File.join(@path, file) FileUtils.mkdir_p ::File.dirname(file_path) File.new ::File.open(file_path, mode) end def rm file ::File.unlink ::File.join(@path, file) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems