Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doabit/activestorage_upyun
Upyun service for activestorage
https://github.com/doabit/activestorage_upyun
Last synced: about 1 month ago
JSON representation
Upyun service for activestorage
- Host: GitHub
- URL: https://github.com/doabit/activestorage_upyun
- Owner: doabit
- License: mit
- Created: 2018-01-20T03:04:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-09T01:31:59.000Z (over 1 year ago)
- Last Synced: 2024-04-25T13:02:35.700Z (7 months ago)
- Language: Ruby
- Size: 75.2 KB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# ActivestorageUpyun
Upyun service for activestorage.## Installation
Add this line to your application's Gemfile:```ruby
gem 'activestorage_upyun', require: false
```Set up upyun storage service in config/storage.yml:
```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:
```ruby
config.active_storage.service = :upyun
```Use for image url
```erb
<%= image_tag @user.avatar.service_url %>
```Or add thumb version named `webpw200`
```erb
<%= 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
```yml
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](https://opensource.org/licenses/MIT).