Sha256: 77462cfd427cb9121a96f106969a4e382505617d0bdcd92387b0cf9375ee1c65

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 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

4 entries across 4 versions & 1 rubygems

Version Path
dynamic_image-0.9.5 lib/binary_storage.rb
dynamic_image-0.9.4 lib/binary_storage.rb
dynamic_image-0.9.3 lib/binary_storage.rb
dynamic_image-0.9.0 lib/binary_storage.rb