No release in over 3 years
Low commit activity in last 3 years
Upyun service for activestorage
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0
>= 0

Runtime

~> 1.0.8
 Project Readme

ActivestorageUpyun

Upyun service for activestorage.

Installation

Add this line to your application's Gemfile:

gem 'activestorage_upyun', require: false

Set up upyun storage service in config/storage.yml:

upyun:
  service: Upyun
  bucket: <%= ENV['UPYUN_BUCKET'] %>
  operator: <%= ENV['UPYUN_OPERATOR'] %>
  password: <%= ENV['UPYUN_PASSWORD'] %>
  host: <%= ENV['UPYUN_HOST'] %>
  folder: <%= ENV['UPYUN_FOLDER'] %>

Set up activestorage service:

config.active_storage.service = :upyun

Use for image url

<%= image_tag @user.avatar.service_url %>

Or add thumb version named webpw200

<%= image_tag @user.avatar.service_url(params: {process: 'webpw200'}) %>

thumb version use ! as default identifier, if you want to use _ as identifier, you can add identifier option

upyun:
  service: Upyun
  bucket: <%= ENV['UPYUN_BUCKET'] %>
  operator: <%= ENV['UPYUN_OPERATOR'] %>
  password: <%= ENV['UPYUN_PASSWORD'] %>
  host: <%= ENV['UPYUN_HOST'] %>
  folder: <%= ENV['UPYUN_FOLDER'] %>
  identifier: _

License

The gem is available as open source under the terms of the MIT License.