Commit 29e6c98
Changed files (4)
app/uploaders/photo_uploader.rb
@@ -4,7 +4,6 @@ class PhotoUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
include CarrierWave::MimeTypes
- storage :fog
process :set_content_type
version :hero do
config/initializers/carrierwave.rb
@@ -0,0 +1,18 @@
+CarrierWave.configure do |config|
+ if Rails.env.test?
+ config.storage = :file
+ config.enable_processing = false
+ else
+ config.storage = :fog
+ config.fog_credentials = {
+ :provider => ENV['FOG_PROVIDER'],
+ :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
+ :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
+ :region => 'us-east-1'
+ }
+ config.fog_directory = ENV['FOG_DIRECTORY']
+ config.fog_public = true
+ config.fog_attributes = {'Cache-Control'=>'max-age=315576000'}
+ config.asset_host = ENV['ASSET_HOST']
+ end
+end
Gemfile
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'jquery-rails'
gem 'carrierwave'
+gem 'fog'
gem 'rmagick'
gem 'sqlite3'
gem 'pg'
Gemfile.lock
@@ -47,6 +47,7 @@ GEM
dotenv-rails (0.7.0)
dotenv (= 0.7.0)
erubis (2.7.0)
+ excon (0.22.1)
execjs (1.4.0)
multi_json (~> 1.0)
factory_girl (4.2.0)
@@ -54,6 +55,17 @@ GEM
factory_girl_rails (4.2.1)
factory_girl (~> 4.2.0)
railties (>= 3.0.0)
+ fog (1.11.1)
+ builder
+ excon (~> 0.20)
+ formatador (~> 0.2.0)
+ json (~> 1.7)
+ mime-types
+ net-scp (~> 1.1)
+ net-ssh (>= 2.1.3)
+ nokogiri (~> 1.5.0)
+ ruby-hmac
+ formatador (0.2.4)
hike (1.2.2)
i18n (0.6.1)
journey (1.0.4)
@@ -69,6 +81,10 @@ GEM
treetop (~> 1.4.8)
mime-types (1.23)
multi_json (1.7.3)
+ net-scp (1.1.1)
+ net-ssh (>= 2.6.5)
+ net-ssh (2.6.7)
+ nokogiri (1.5.10)
pg (0.15.1)
polyglot (0.3.3)
rack (1.4.5)
@@ -108,6 +124,7 @@ GEM
rspec-core (~> 2.13.0)
rspec-expectations (~> 2.13.0)
rspec-mocks (~> 2.13.0)
+ ruby-hmac (0.4.0)
sass (3.2.9)
sass-rails (3.2.6)
railties (~> 3.2.0)
@@ -138,6 +155,7 @@ DEPENDENCIES
coffee-rails (~> 3.2.1)
dotenv-rails
factory_girl_rails
+ fog
jquery-rails
kaminari
pg