2011-04-06 23:34:36 +00:00
|
|
|
require 'locomotive'
|
|
|
|
|
2011-03-21 10:42:36 +00:00
|
|
|
# TODO: Make this store to RAILS_ROOT/permanent
|
|
|
|
|
|
|
|
# On bushido, the app directory is destroyed on every update, so everything is lost.
|
|
|
|
# The only place this doesn't happen is the RAILS_ROOT/permanent folder.
|
|
|
|
# Also, RAILS_ROOT/permanent/store is symlinked to RAILS_ROOT/public/store on every update,
|
|
|
|
# so store your publicly-accessible files here (e.g. templates, etc.)
|
|
|
|
|
2010-12-16 23:42:38 +00:00
|
|
|
CarrierWave.configure do |config|
|
|
|
|
|
2011-04-06 23:34:36 +00:00
|
|
|
config.cache_dir = File.join(Rails.root, 'tmp', 'uploads')
|
|
|
|
|
2010-12-16 23:42:38 +00:00
|
|
|
case Rails.env.to_sym
|
|
|
|
|
|
|
|
when :development
|
|
|
|
config.storage = :file
|
|
|
|
config.root = File.join(Rails.root, 'public')
|
|
|
|
|
|
|
|
when :production
|
2011-04-06 23:34:36 +00:00
|
|
|
if Locomotive.bushido?
|
|
|
|
config.storage = :file
|
2011-04-24 23:21:38 +00:00
|
|
|
config.root = File.join(Rails.root, 'public')
|
2011-04-07 09:53:07 +00:00
|
|
|
config.store_dir = 'store'
|
2011-04-06 23:34:36 +00:00
|
|
|
else
|
|
|
|
config.storage = :s3
|
|
|
|
config.s3_access_key_id = ENV['S3_KEY_ID']
|
|
|
|
config.s3_secret_access_key = ENV['S3_SECRET_KEY']
|
|
|
|
config.s3_bucket = ENV['S3_BUCKET']
|
|
|
|
# config.s3_cname = 'ENV['S3_CNAME']
|
|
|
|
end
|
2010-12-16 23:42:38 +00:00
|
|
|
end
|
|
|
|
|
2011-04-06 23:34:36 +00:00
|
|
|
end unless Locomotive.engine?
|