Module: CarrierWave

Defined in:
lib/carrierwave/compatibility/paperclip.rb,
lib/carrierwave.rb,
lib/carrierwave/mount.rb,
lib/carrierwave/uploader.rb,
lib/carrierwave/orm/sequel.rb,
lib/carrierwave/storage/s3.rb,
lib/carrierwave/storage/file.rb,
lib/carrierwave/uploader/url.rb,
lib/carrierwave/test/matchers.rb,
lib/carrierwave/orm/datamapper.rb,
lib/carrierwave/sanitized_file.rb,
lib/carrierwave/uploader/cache.rb,
lib/carrierwave/uploader/paths.rb,
lib/carrierwave/uploader/proxy.rb,
lib/carrierwave/uploader/store.rb,
lib/carrierwave/uploader/remove.rb,
lib/carrierwave/orm/activerecord.rb,
lib/carrierwave/storage/abstract.rb,
lib/carrierwave/uploader/versions.rb,
lib/carrierwave/processing/rmagick.rb,
lib/carrierwave/uploader/callbacks.rb,
lib/carrierwave/uploader/mountable.rb,
lib/carrierwave/uploader/processing.rb,
lib/carrierwave/uploader/default_path.rb,
lib/carrierwave/processing/image_science.rb,
lib/carrierwave/uploader/extension_whitelist.rb

Overview

This file contains code taken from Paperclip

LICENSE

The MIT License

Copyright © 2008 Jon Yurek and thoughtbot, inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: ActiveRecord, Compatibility, DataMapper, ImageScience, Mount, RMagick, Sequel, Storage, Test, Uploader Classes: FormNotMultipart, IntegrityError, InvalidParameter, NoFileError, ProcessingError, SanitizedFile, UploadError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



7
8
9
# File 'lib/carrierwave.rb', line 7

def config
  @config
end

.loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/carrierwave.rb', line 7

def logger
  @logger
end

Class Method Details

.generate_cache_idObject

Generates a unique cache id for use in the caching system

Returns

String

a cache id in the format YYYYMMDD-HHMM-PID-RND



22
23
24
# File 'lib/carrierwave.rb', line 22

def generate_cache_id
  Time.now.strftime('%Y%m%d-%H%M') + '-' + Process.pid.to_s + '-' + ("%04d" % rand(9999))
end