lib/storage.rb in storage-0.1.5 vs lib/storage.rb in storage-0.2.0
- old
+ new
@@ -1,24 +1,25 @@
require "ostruct"
-require "fileutils" unless defined?(FileUtils)
-require "storage/errors"
-require "aws/s3"
+require "fileutils"
+require "fog"
module Storage
- autoload :Config, "storage/config"
- autoload :Strategies, "storage/strategies"
- autoload :Version, "storage/version"
+ require "storage/errors"
+ require "storage/config"
+ require "storage/strategies"
+ require "storage/version"
# Set up the storage options.
#
# Storage.setup do |config|
# config.strategy = :s3
# end
#
# Check Storage::Config for available options.
#
- def self.setup(&block)
+ def self.setup
yield Config
+ strategy.prepare!
end
# A shortcut to the current strategy.
def self.strategy
Config.strategy_class