All Projects → katafrakt → hanami-shrine

katafrakt / hanami-shrine

Licence: MIT license
Upload solution for Hanami using Shrine library

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to hanami-shrine

acf-dropzone
Drop file uploads directly on ACF file fields
Stars: ✭ 31 (+10.71%)
Mutual labels:  upload
vim-hanami
Hanami framework vim support
Stars: ✭ 13 (-53.57%)
Mutual labels:  hanami
lambda-multipart-parser
This nodejs module will parse the multipart-form containing files and fields from the AWS lambda event object. It works very well parsing binary and text files.
Stars: ✭ 45 (+60.71%)
Mutual labels:  upload
svelte-filepond
🔌 A handy FilePond adapter component for Svelte
Stars: ✭ 188 (+571.43%)
Mutual labels:  upload
EspBuddy
Wrapper to easily upload (OTA or Serial), backup, batch query, monitor ESP8266 boards using Esptool.py, Espota.py and Platformio
Stars: ✭ 47 (+67.86%)
Mutual labels:  upload
uploadex
Elixir library for handling uploads with Ecto, Phoenix and Absinthe
Stars: ✭ 23 (-17.86%)
Mutual labels:  upload
Hanami
The web, with simplicity.
Stars: ✭ 5,584 (+19842.86%)
Mutual labels:  hanami
windows-azure-storage
Use the Microsoft Azure Storage service to host your website's media files.
Stars: ✭ 48 (+71.43%)
Mutual labels:  upload
ionic4-image-crop-upload
Ionic 4, Angular 7 and Cordova Crop and Upload Image
Stars: ✭ 16 (-42.86%)
Mutual labels:  upload
shrine-cloudinary
Cloudinary storage for Shrine
Stars: ✭ 23 (-17.86%)
Mutual labels:  shrine
bookshelf
Hanami "Getting Started" project
Stars: ✭ 20 (-28.57%)
Mutual labels:  hanami
react-magic-dropzone
✨Magically drag and drop files/links for uploading
Stars: ✭ 11 (-60.71%)
Mutual labels:  upload
direct-upload-s3-signaturev4
Example of Directly uploading files to S3 with PHP
Stars: ✭ 50 (+78.57%)
Mutual labels:  upload
httpfs
Go 编写的静态文件服务器,支持文件拖拽上传,无第三方包依赖, 支持 Windows, Linux , Darwin。
Stars: ✭ 28 (+0%)
Mutual labels:  upload
blobUpload
Uses file slice to upload large files. Newer version https://github.com/apivideo/uploadavideoApps. From api.video (https://api.video)
Stars: ✭ 19 (-32.14%)
Mutual labels:  upload
WP-Media-Uploader
Easily create a custom media upload button in WordPress admin dashboard that you can use in your plugin
Stars: ✭ 25 (-10.71%)
Mutual labels:  upload
react-native-tus-client
React Native client for the tus resumable upload protocol.
Stars: ✭ 38 (+35.71%)
Mutual labels:  upload
tiny-qiniu-request
tiny-qiniu for rc-upload or antd upload component `customRequest` property
Stars: ✭ 13 (-53.57%)
Mutual labels:  upload
PHP-FileUpload
Simple and convenient file uploads — secure by default
Stars: ✭ 53 (+89.29%)
Mutual labels:  upload
Outlook-Add-in-SSO
[MOVED] The sample implements an Outlook add-in that uses Office's SSO system to get access to Microsoft Graph APIs and adds buttons to the Outlook ribbon.
Stars: ✭ 48 (+71.43%)
Mutual labels:  attachment

Hanami::Shrine

Current status: this gem's development is currently on hold, waiting for Hanami 2 to be released (which will probably make it obsolete anyway).

This gem aims at providing support for Shrine uploader in Hanami applications. It also tries to be as simple as possible, without polluting the world around.

Build Status Gem Version Code Climate

Installation

Add this line to your application's Gemfile:

gem 'hanami-shrine'

And then execute:

$ bundle

Usage

Setup Shrine with hanami plugin enabled. Check Shrine's repository for more detailed description of the process.

class ImageAttachment < Shrine
  plugin :hanami
end

Then, in your repository add (assuming your attachment is avatar):

prepend ImageAttachment.repository(:avatar)

And in your entity:

include ImageAttachment[:avatar]

For inspiration read a blog post, look at the specs or example repo.

Important changes since 0.1 version

As Hanami has been upgraded to 0.9, it started to use new engine for the entities in hanami-model. It required heavy changes in hanami-shrine to accomodate to new paradigm. Unfortunately, some of them are breaking. Here's a summary list:

  • Validations are gone (for now, hopefully)
  • You need to use prepend instead of extend in your repository
  • Entities are now read-only. You need to initialize them with the attachment, not add it later: MyEntity.new(avatar: File.open('my_avatar.png'). This is a Hanami change, but it's worth mentioning here as well.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Testing

Testing is done against 3 major database engines: PostgreSQL, MySQL and sqlite3. It is steered by environment variable DB. To run locally, first cp .env.travis .env, then put values matching your local configuration there. After that, you can test all three versions:

DB=sqlite bundle exec rake
DB=postgres bundle exec rake
DB=mysql bundle exec rake

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/katafrakt/hanami-shrine.

License

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

Cat images (used in tests) are public domain taken from Wikimedia Commons.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].