Skip to content
UpYun storage for CarrierWave
Ruby
Pull request Compare This branch is 29 commits behind nowa:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
Gemfile.lock
README.md
carrierwave-upyun.gemspec

README.md

CarrierWave for Upyun

This gem adds support for Upyun.com to CarrierWave

Installation

gem install carrierwave-upyun

Or using Bundler, in Gemfile

gem 'rest-client'
gem 'carrierwave-upyun'

Configuration

You'll need to configure the to use this in config/initializes/carrierwave.rb

CarrierWave.configure do |config|
  config.storage = :upyun
  config.upyun_username = "xxxxxx"
  config.upyun_password = 'xxxxxx'
  config.upyun_bucket = "my_bucket"
  config.upyun_bucket_domain = "my_bucket.files.example.com"
end

And then in your uploader, set the storage to :upyun:

class AvatarUploader < CarrierWave::Uploader::Base
  storage :upyun
end

You can override configuration item in individual uploader like this:

class AvatarUploader < CarrierWave::Uploader::Base
  storage :upyun

  self.upyun_bucket = "avatars"
  self.upyun_bucket_domain = "avatars.files.example.com"
end
Something went wrong with that request. Please try again.