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

Version Path
hobo-inviqa-0.0.15 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.14 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.13 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.11 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc11 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc10 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc9 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc8 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc7 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc6 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc4 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.10.pre.rc2 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.9 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.9.pre.rc2 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.9.pre.rc1 lib/hobo/lib/s3/local/iohandler.rb
hobo-inviqa-0.0.9.pre.alpha lib/hobo/lib/s3/local/iohandler.rb