Skip to content

doabit/carrierwave-upyun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

UpYun storage for CarrierWave

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%