Sha256: 4e7289a1e4d32a77d8f1b466ed316b6e68dac67db32fe14c21c748ad8b567254

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

require 'tempfile'
require 'digest/sha1'

require 'rails'
require 'active_record'

require File.join(File.dirname(__FILE__), 'binary_storage/active_record_extensions')
require File.join(File.dirname(__FILE__), 'binary_storage/blob')

module BinaryStorage
  class << self
    def storage_dir
      @@storage_dir ||= Rails.root.join('db/binary_storage', Rails.env)
    end

    def storage_dir=(new_storage_dir)
      @@storage_dir = new_storage_dir
    end

    def hexdigest_file(path)
      Digest::SHA1.file(path).hexdigest
    end

    def hexdigest(string)
      Digest::SHA1.hexdigest(string)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dynamic_image-1.0.4 lib/binary_storage.rb
dynamic_image-1.0.3 lib/binary_storage.rb
dynamic_image-1.0.2 lib/binary_storage.rb
dynamic_image-1.0.1 lib/binary_storage.rb
dynamic_image-0.9.9 lib/binary_storage.rb