Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Trailing whitespace

  • Loading branch information...
commit 83ed98e215d53dbac52f40d4b099b7c587278c6f 1 parent 3b415b6
@bensie bensie authored
View
4 lib/carrierwave/storage/cloud_files.rb
@@ -7,8 +7,8 @@ module Storage
##
# Uploads things to Rackspace Cloud Files webservices using the Rackspace libraries (cloudfiles gem).
# In order for CarrierWave to connect to Cloud Files, you'll need to specify an username, api key
- # and container. Optional arguments are config.cloud_files_snet (using the private internal
- # Rackspace network for communication) and config.cloud_files_auth_url (for connecting to Rackspace's
+ # and container. Optional arguments are config.cloud_files_snet (using the private internal
+ # Rackspace network for communication) and config.cloud_files_auth_url (for connecting to Rackspace's
# UK infrastructure or an OpenStack Swift installation)
#
# CarrierWave.configure do |config|
View
6 lib/carrierwave/storage/file.rb
@@ -13,11 +13,11 @@ class File < Abstract
##
# Move the file to the uploader's store path.
#
- # By default, store!() uses copy_to(), which operates by copying the file
- # from the cache to the store, then deleting the file from the cache.
+ # By default, store!() uses copy_to(), which operates by copying the file
+ # from the cache to the store, then deleting the file from the cache.
# If move_to_store() is overriden to return true, then store!() uses move_to(),
# which simply moves the file from cache to store. Useful for large files.
- #
+ #
# === Parameters
#
# [file (CarrierWave::SanitizedFile)] the file to store
View
6 lib/carrierwave/uploader/cache.rb
@@ -90,9 +90,9 @@ def cache_name
##
# Caches the given file. Calls process! to trigger any process callbacks.
#
- # By default, cache!() uses copy_to(), which operates by copying the file
- # to the cache, then deleting the original file. If move_to_cache() is
- # overriden to return true, then cache!() uses move_to(), which simply
+ # By default, cache!() uses copy_to(), which operates by copying the file
+ # to the cache, then deleting the original file. If move_to_cache() is
+ # overriden to return true, then cache!() uses move_to(), which simply
# moves the file to the cache. Useful for large files.
#
# === Parameters
View
4 lib/carrierwave/uploader/versions.rb
@@ -148,8 +148,8 @@ def version_name
# my_uploader.url # => /path/to/my/uploader.gif
# my_uploader.url(:thumb) # => /path/to/my/thumb_uploader.gif
# my_uploader.url(:thumb, :small) # => /path/to/my/thumb_small_uploader.gif
- # my_uploader.url(:query => {"response-content-disposition" => "attachment"})
- # my_uploader.url(:version, :sub_version, :query => {"response-content-disposition" => "attachment"})
+ # my_uploader.url(:query => {"response-content-disposition" => "attachment"})
+ # my_uploader.url(:version, :sub_version, :query => {"response-content-disposition" => "attachment"})
#
# === Parameters
#
View
2  lib/generators/templates/uploader.rb
@@ -5,7 +5,7 @@ class <%= class_name %>Uploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
-
+
# Include the Sprockets helpers for Rails 3.1+ asset pipeline compatibility:
# include Sprockets::Helpers::RailsHelper
# include Sprockets::Helpers::IsolatedHelper
View
8 spec/sanitized_file_spec.rb
@@ -181,8 +181,8 @@
@sanitized_file = CarrierWave::SanitizedFile.new(:content_type => 'image/png')
@sanitized_file.content_type.should == 'image/png'
end
-
- it "should handle Mime::Type object" do
+
+ it "should handle Mime::Type object" do
@file = File.open(file_path('sponsored.doc'))
@file.stub!(:content_type).and_return(MIME::Type.new('application/msword'))
@sanitized_file = CarrierWave::SanitizedFile.new(@file)
@@ -523,7 +523,7 @@
end
end
-
+
describe "with a valid File object and an empty file" do
before do
FileUtils.cp(file_path('test.jpg'), file_path('llama.jpg'))
@@ -549,7 +549,7 @@
end
end
-
+
describe "with a valid path" do
before do
FileUtils.cp(file_path('test.jpg'), file_path('llama.jpg'))
View
28 spec/uploader/store_spec.rb
@@ -326,47 +326,47 @@ def filename
end
end
-
+
describe "#store! with the move_to_store option" do
-
+
before do
@file = File.open(file_path('test.jpg'))
@uploader_class.permissions = 777
CarrierWave.stub!(:generate_cache_id).and_return('20071201-1234-345-2255')
end
-
+
context "set to true" do
before do
@uploader_class.move_to_store = true
end
-
+
it "should move it from the tmp dir to the store dir" do
@uploader.cache!(@file)
-
+
@cached_path = @uploader.file.path
@stored_path = ::File.expand_path(@uploader.store_path, @uploader.root)
-
+
@cached_path.should == public_path('uploads/tmp/20071201-1234-345-2255/test.jpg')
File.exists?(@cached_path).should be_true
File.exists?(@stored_path).should be_false
-
+
@uploader.store!
-
+
File.exists?(@cached_path).should be_false
File.exists?(@stored_path).should be_true
end
-
+
it "should use move_to() during store!()" do
@uploader.cache!(@file)
@stored_path = ::File.expand_path(@uploader.store_path, @uploader.root)
-
+
@uploader.file.should_receive(:move_to).with(@stored_path, 777)
@uploader.file.should_not_receive(:copy_to)
-
+
@uploader.store!
end
end
-
+
context "set to false" do
before do
@uploader_class.move_to_store = false
@@ -375,10 +375,10 @@ def filename
it "should use copy_to() during store!()" do
@uploader.cache!(@file)
@stored_path = ::File.expand_path(@uploader.store_path, @uploader.root)
-
+
@uploader.file.should_receive(:copy_to).with(@stored_path, 777)
@uploader.file.should_not_receive(:move_to)
-
+
@uploader.store!
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.