lib/carrierwave/storage/file.rb in carrierwave-0.2.4 vs lib/carrierwave/storage/file.rb in carrierwave-0.3.0

- old
+ new

@@ -6,27 +6,22 @@ # to it, it uses the store_dir defined on the uploader as the storage location. That's # pretty much it. # class File < Abstract - def initialize(uploader) - @uploader = uploader - end - ## # Move the file to the uploader's store path. # # === Parameters # - # [uploader (CarrierWave::Uploader)] an uploader object # [file (CarrierWave::SanitizedFile)] the file to store # # === Returns # # [CarrierWave::SanitizedFile] a sanitized file # - def self.store!(uploader, file) + def store!(file) path = ::File.join(uploader.store_path) path = ::File.expand_path(path, uploader.public) file.move_to(path, CarrierWave.config[:permissions]) file end @@ -34,17 +29,16 @@ ## # Retrieve the file from its store path # # === Parameters # - # [uploader (CarrierWave::Uploader)] an uploader object # [identifier (String)] the filename of the file # # === Returns # # [CarrierWave::SanitizedFile] a sanitized file # - def self.retrieve!(uploader, identifier) + def retrieve!(identifier) path = ::File.join(uploader.store_path(identifier)) path = ::File.expand_path(path, uploader.public) CarrierWave::SanitizedFile.new(path) end