# File lib/remote_files.rb, line 55 def self.primary_store default_configuration.primary_store end
module RemoteFiles
This is good for use in development
This is good for use in tests. Be sure to call clear! before each test run.
Constants
- CONFIGURATIONS
- MockStore
- VERSION
Public Class Methods
Source
# File lib/remote_files.rb, line 43 def self.add_store(store_identifier, options = {}, &block) default_configuration.add_store(store_identifier, options, &block) end
Source
# File lib/remote_files.rb, line 24 def self.configure(name, hash = {}) if name.is_a?(Hash) hash = name name = :default end CONFIGURATIONS[name.to_sym].from_hash(hash) end
Source
# File lib/remote_files.rb, line 20 def self.default_configuration CONFIGURATIONS[:default] end
Source
# File lib/remote_files.rb, line 73 def self.delete_file(file = nil, &block) if file if @delete_file @delete_file.call(file) else file.delete_now! end elsif block_given? @delete_file = block else raise "invalid call to RemoteFiles.delete_file" end end
Source
# File lib/remote_files.rb, line 37 def self.logger return @logger if defined?(@logger) @logger ||= defined?(Rails) ? Rails.logger : nil end
Source
# File lib/remote_files.rb, line 33 def self.logger=(logger) @logger = logger end
Source
# File lib/remote_files.rb, line 51 def self.lookup_store(store_identifier) default_configuration.lookup_store(store_identifier) end
Source
Source
# File lib/remote_files.rb, line 47 def self.stores default_configuration.stores end
Source
# File lib/remote_files.rb, line 59 def self.synchronize_stores(file = nil, &block) if file if @synchronize_stores @synchronize_stores.call(file) else file.synchronize! end elsif block_given? @synchronize_stores = block else raise "invalid call to RemoteFiles.synchronize_stores" end end