Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/shrinerb/shrine

File Attachment toolkit for Ruby applications
https://github.com/shrinerb/shrine

Fix passing a variable number of block arguments

If someone is splatting the arguments of the given lambda, the arity
will be negative, so we con...

260dcb322121fdcae66e14edb2d4c1d41f0210d9 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove :include_error from remote_url plugin

We can instead just check the arity of the given block, and pass the
appropriate amount of argum...

38c220c489070156213b8112662234e265172477 authored over 8 years ago by Janko Marohnić <[email protected]>
Change how upload options and metadata are passed

Passing upload options via {"s3" => {...}} was always awkward. I did it
to preserve backwards co...

76b7631f94f07dd4003e857cc6ea4d8c1946c83f authored over 8 years ago by Janko Marohnić <[email protected]>
Persist plugin options when reapplying a plugin

This change makes the following work:

Shrine.plugin :download_endpoint,
storages: [:store...

7a72b8674c8dad7e61909634a9055860a09ad8db authored over 8 years ago by Janko Marohnić <[email protected]>
Remove Shrine::Confirm functionality

It isn't necessary that clearing the storage needs to be confirmed;
deleting all records in the ...

95e2ae180e8b71751bf7da1a2052ba2a06ddf457 authored over 8 years ago by Janko Marohnić <[email protected]>
Upgrade JRuby on CI

The previous JRuby version started hanging randomly, making Travis error
due to timeout. Perhaps...

f431a72c18dd40c151aa7aa08074ef3cedd34217 authored over 8 years ago by Janko Marohnić <[email protected]>
Allow combining dimensions analyzers

d492c7a5ad84ab9ceec0763160ddbb53c7c4dc55 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't error when MimeMagic cannot determine MIME

31c280a43280ff1046b8b89162f615eed1fa9363 authored over 8 years ago by Janko Marohnić <[email protected]>
Allow combining MIME type analyzers

Prior to this change you couldn't combine other analyzers, because the
lambda specified as a cus...

49975bee96de2f14633a97433227d286bc6e2a20 authored over 8 years ago by Janko Marohnić <[email protected]>
Note not needing to download file in #process

This is even recommended, as some storages like S3 or Cloudinary will
avoid downloading/uploadin...

c156ec984256a995918c5859811927c62f8375b3 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't check #exists? in restore_cached_data

This is not necessary, as the code will error anyway if the cached file
doesn't exist (in the ca...

c251ea1612a74421079078e4b11aea0af9a5bd15 authored over 8 years ago by Janko Marohnić <[email protected]>
Deprecate migration_helpers plugin

The idea of this plugin was very fuzzy in the first place. It was just a
collection of helper me...

fc5c4077b9ff6f2e90dcaace8d377140fc11e982 authored over 8 years ago by Janko Marohnić <[email protected]>
Generalize implementation of promoting

This change adds the same method signature to #_promote that #promote
has. Also, now the `:phase...

ea8eeadf286821eaaa33326bb35d6c306fe44b50 authored over 8 years ago by Janko Marohnić <[email protected]>
Reject same cached attachment before Attacher#set

This makes restore_cached_data not trigger when form is submitted again
with the cached attachme...

e96bad55ab28a0404f709cdba1b0026ded35fc4f authored over 8 years ago by Janko Marohnić <[email protected]>
Use symbols instead of strings for ivars

965d5a27560b1811c38d040f346f2a5c4b15c5b3 authored over 8 years ago by Janko Marohnić <[email protected]>
Add Attacher#_delete which backgrounds #delete!

Now that Attacher#delete! was made public, users should be able to use
it synchronously even if ...

619b26b761018def3b0a5c522e9e1dff6ac37902 authored over 8 years ago by Janko Marohnić <[email protected]>
Move attacher dumping to Attacher#dump

It makes more sense that the attacher can dump itself, and it makes the
implementation shorter b...

f764a54d97bc9fc8e28782168b173879498a6851 authored over 8 years ago by Janko Marohnić <[email protected]>
Make Attacher#cache!, #store!, and #delete! public

This is handy when you want to customize the upload process, and you
want to cache/store/delete ...

c5c39637d0afea321c47865f64f8ec8c55e43f2b authored over 8 years ago by Janko Marohnić <[email protected]>
Don't cache dynamic storages

I thought that the block will always be deterministic, that the storage
will always be determine...

7f790d1bb02d9047cf49a2d4380f4c9cf090c637 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't use Roda streaming in download_endpoint

Roda's streaming plugin was designed for when you have custom streaming
logic. However, all we h...

c56bc8fc573d6154fc35cacc7b5c712a786a6491 authored over 8 years ago by Janko Marohnić <[email protected]>
Make only one HTTP request in download_endpoint

What we do in download_endpoint is turn #stream method on the storage
into an Enumerator. We the...

9a2fd7b6ecf8489f3f57905bd909ad932f58d757 authored over 8 years ago by Janko Marohnić <[email protected]>
Warn when not using determine_mime_type plugin

The "mime_type" metadata field is by default set from "Content-Type"
request header. However, th...

6fb2e53114918c244a877b1e4987523fdbd2c221 authored over 8 years ago by Janko Marohnić <[email protected]>
Rename variable

7f3dd8742c5f0d0a844a5aad88dcd7ea28053f27 authored over 8 years ago by Janko Marohnić <[email protected]>
Link shrine-mongoid on the website

ea09e97f3e1aa61b14d3ea453a108bdf85f6753b authored over 8 years ago by Janko Marohnić <[email protected]>
Support Mongoid in backgrounding plugin

Mongoid records return a BSON::ObjectId when you ask them for an ID,
which isn't serializable to...

088bf740b44cdab6b027ba3c8e97438620473f1b authored over 8 years ago by Janko Marohnić <[email protected]>
Allow non-Sequel attachments in sequel plugin

We may want to use Shrine in an application where some models are Sequel
models, and others are ...

fdb786d540fe43e9482f615da5d72de5ae332922 authored over 8 years ago by Janko Marohnić <[email protected]>
Use @name variable in Attachment#initialize

This removes any visual ambiguity when reading the code. This is because
Attachment#name already...

4939c2a4022f05ce2177cd038b0d327eee69d5c9 authored over 8 years ago by Janko Marohnić <[email protected]>
Link shrine-reform on the website

99b7091b9cdbb2a94e10f9cd4dc825eb7055d4d5 authored over 8 years ago by Janko Marohnić <[email protected]>
class_eval => module_eval on Shrine::Attachment

They are aliases, but since an instance of Shrine::Attachment is a
module, it's more intention r...

775287afaa24901090b17b9a4fb52280e8205d6f authored over 8 years ago by Janko Marohnić <[email protected]>
Call create_table through ActiveRecord connection

Before we were calling it through ActiveRecord::Migration, which added
additional migration outp...

5793a4023c78e9f3c87d58988df360cab212e19d authored over 8 years ago by Janko Marohnić <[email protected]>
Tweaks to the "Design of Shrine" guide

5817f12e9cff4500ba66bf51be020be3b55c0678 authored over 8 years ago by Janko Marohnić <[email protected]>
Add "Design of Shrine" guide

It's useful for contributors or people who are interested to learn about
how Shrine is designed.

3d12342a76c5b00261538e0a6fd31854caf57f22 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove unused Roda plugin in direct_upload

The json_parser Roda plugin parses JSON request body and merges the hash
into `request.params`. ...

5825d5936c966facffd5d557e5021b251e789c99 authored over 8 years ago by Janko Marohnić <[email protected]>
Update generalized gems' description in gemspec

We change this in the README, to hint that Shrine does not only have
functionality for uploading...

73ba0d21d4fd4f345f6ab3081704f80d1c3ac35a authored over 8 years ago by Janko Marohnić <[email protected]>
Refactor swapping stored file back to how it was

We've had a journey through trying to eliminate an actually harmless
race condition, through whi...

f60ad21ef0fb6a51d6a5ba1741ca8166d241ab91 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't create unnecessary "#{name}_data" strings

Since the :"#{name}_data" symbol will already be declared even without
Shrine, using it won't al...

38c31efb477df56e5ccaccc90382aabea7939829 authored over 8 years ago by Janko Marohnić <[email protected]>
Random documentation improvements and fixes

b893b3701d4be2dbc170b035d2bb74229672de40 authored over 8 years ago by Janko Marohnić <[email protected]>
Tweak test style and add CHANGELOG entry

1d978ae5d4878428447b68bfb9d845a92d558dc5 authored over 8 years ago by Janko Marohnić <[email protected]>
Fix file command in determine_mime_type plugin

The `file` utility's option parser is greedy and interprets every
argument that begins with a hy...

9f72a9c0d8c2620f51308d058f7eea640cf1ba1e authored over 8 years ago by Michael Macias <[email protected]>
Add back extracting filenames from Tempfiles

This is a backwards-incompatible change which we didn't (couldn't)
deprecate before, and it's no...

43c0187653f3c8a1280608796e7c12c8d56ef3d2 authored over 8 years ago by Janko Marohnić <[email protected]>
Extract memory storage into shrine-memory gem

It's really useful to be able to use the memory storage when developing
external plugins, so ins...

54be13644069d0d68a276b7b1342be2c1249462e authored over 8 years ago by Janko Marohnić <[email protected]>
Note in upload_options that you can pass hashes

60dab37ef80b9e5185deaafbf409f445ed11d784 authored over 8 years ago by Janko Marohnić <[email protected]>
Allow including module to non-ActiveRecord objects

This is preparation for the upcoming shrine-reform gem, so that the
following is possible:

Sh...

68ddd6097efebdc6fbfde19c763676a68bec778a authored over 8 years ago by Janko Marohnić <[email protected]>
Improve README

We remove "users" and "avatars", because these are old terms. People
should never have a "User"...

7650c9b041d36ff5fd5a907f40576288a5d0b6b8 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove "restore_cached" alias for restore_cached_data

26190c0a6eb32e91076b18c9cf745c2ac1275c31 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove "delete_uploaded" alias for delete_raw

1d5a99be0e443e9f8ab4b841a7f04e230f13a932 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove Attacher#default_url from base

This was accidentally left over when we were removing
`Shrine#default_url`.

c4e116150d104277faaeb7a50d5cebf0633f5b21 authored over 8 years ago by Janko Marohnić <[email protected]>
Make default generated unique location shorter

We just use the default length of `SecureRandom.hex`, which is 32, where
before it was 60. This ...

03e49f4f55ff0ed87f04f2e9ca8f893cc1ebf4aa authored over 8 years ago by Janko Marohnić <[email protected]>
Default :delegate in migration_helpers to false

The default behaviour should be non-pollution, so we make the pollution
opt-in rather than opt-out.

01ecea90bd51e16f3c69077882f977dff81b3543 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove "fake moving" from moving plugin

The moving plugin was previously playing a double role: if the storage
supports moving, the file...

cdbca25aa62449c3aa5b2d2fab6db1c4889dbae0 authored over 8 years ago by Janko Marohnić <[email protected]>
Stop testing deprecated /:storage/:name route

The deprecation warning adds clutter to test output.

63d3c43e691f23bbf1bfe9d4265c3ebf003a4f9d authored over 8 years ago by Janko Marohnić <[email protected]>
Test S3 storage URL with :host and nested key

32e11d281f5b545962e7b240abfda25289a948e8 authored over 8 years ago by Janko Marohnić <[email protected]>
Stop testing Rubinius

Rubinius has mutable versions, meaning new code can be republished on
the same version, which me...

32eaf454aeeea15c98346c7d1a3d0b29943bc508 authored over 8 years ago by Janko Marohnić <[email protected]>
Rename delete phase to be shorter and consistent

replaced => replace
destroyed => destroy
stored => abort
invalid => validate

We did this ...

d4969e676da6069d1158d7aa70cbeac5d225f9f9 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove deprecated Shrine#default_url

Developers should use the default_url plugin instead.

448167ca4b3775d8b7991d5dd41fc5018c230915 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove deprecated :subdirectory in FileSystem

6e651aae57242848c2f41f9aafcf254551947df4 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't return uploaded file in Attacher#set

This will instantiate a new Shrine::UploadedFile instance which isn't
used anywhere in Shrine, s...

75332f9be09484f67852c3a8c023761ff47240b8 authored over 8 years ago by Janko Marohnić <[email protected]>
Make backgrounding methods return the attacher

The attacher instance contains more information than the record, and it
makes more sense since w...

3b3e865f7e232742da23bba5415ba95942733d75 authored over 8 years ago by Janko Marohnić <[email protected]>
Rename some key names in backgrounding plugin

The "name" key is more accurate than "attachment", because that's what
it is. The "attachment" k...

222fa826401f953e69562d7397fb83f048fef63d authored over 8 years ago by Janko Marohnić <[email protected]>
Remove using :presign instead of :presign_options

aeec297fae2038173be3269a006a20af3ece6c7f authored over 8 years ago by Janko Marohnić <[email protected]>
Remove deprecated Shrine.direct_endpoint from direct_upload plugin

f4ec3fd2dffdb0e8b09e4d4280d9885ef15b8486 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove deprecated keep_location plugin

be32968e420c6c05c71dbc001f3a66c06800cdfc authored over 8 years ago by Janko Marohnić <[email protected]>
Make Shrine#extract_dimensions private

This is consistent with other metadata-extracting Shrine's methods.

62954446554f38a853a1f3d68747364609ae741e authored over 8 years ago by Janko Marohnić <[email protected]>
Keep methods visibility in determine_mime_type

Shrine's #extract_mime_type method is private, but the
determine_mime_type plugin accidentally m...

1dfd1be9d83f2c8e1af34dc9429865c185287d9f authored over 8 years ago by Janko Marohnić <[email protected]>
Don't load Sequel's instance_filters plugin

This was left over from the implementation in version 1.4.1 where we
used Sequel's instance_filt...

0a05df402b68a8ca652fb8587eefb3d1433f0234 authored over 8 years ago by Janko Marohnić <[email protected]>
Fix names of some storage options

ef2789324a6b84cf0f025fe7b2d1a971bfb1eebc authored over 8 years ago by Janko Marohnić <[email protected]>
Deprecate old name for the backgrounding plugin

3edc0029a8841f7f46ad0360b639eafbc1214005 authored over 8 years ago by Janko Marohnić <[email protected]>
Don't store filenames of Tempfiles to metadata

The filename of a Tempfile doesn't contain any useful information, it's
just an randomly generat...

6cb25170095dcd55d6ba6d76f7a5122a61d40d7a authored over 8 years ago by Janko Marohnić <[email protected]>
Add a long description for RubyGems

63fdbfb9cce2ff8a70b2a08547fba14f8a7a6b5f authored over 8 years ago by Janko Marohnić <[email protected]>
Don't use #mime_type for extracting MIME type

This was the behaviour when Shrine#extract_metadata was receiving
Shrine::UploadedFiles. The det...

a3d42bdc7fe4048e275ba0be2ccac790a9a3b37d authored over 8 years ago by Janko Marohnić <[email protected]>
Don't use #width and #height in store_dimensions

UploadedFiles aren't passed to Shrine#extract_metadata anymore, so we
can safely remove this check.

8c0c888b853a2a83d5c2fd8af837eb402c6d5a57 authored over 8 years ago by Janko Marohnić <[email protected]>
Prepare for version 1.4.2

8cc2ef72816cad8db9d4a7b6e2765d384ce69731 authored over 8 years ago by Janko Marohnić <[email protected]>
Fixed some issues around promoting

This commit reverts the behaviour of promoting as it was in 1.4.0.
Version 1.4.1 introduced some...

28b5447d14acd18ce7048964bfa6be6dec2ec6b3 authored over 8 years ago by Janko Marohnić <[email protected]>
Prepare for version 1.4.1

378b6c57fb054ac4efb85d60c6d6055d5fda6ab6 authored over 8 years ago by Janko Marohnić <[email protected]>
Refactor ORM plugin tests

6ee8d07c369d67b1c2c90b0d38e7377e56cf4256 authored over 8 years ago by Janko Marohnić <[email protected]>
Bring back promoting triggering callbacks

In 1.4.0 we switched promoting to updating through datasets/relations,
to eliminate a tiny possi...

706ee202229287dcf5a7aead390d0c7f7105ac2f authored over 8 years ago by Janko Marohnić <[email protected]>
Remove reference to delete_uploaded plugin

10151db5d0bb2a4a329950d1cdb6b9d6fc55045e authored over 8 years ago by Janko Marohnić <[email protected]>
Small download_endpoint documentation improvements

919f3fe4e55a7e9aeab1537f9a1ac5e1a21979eb authored over 8 years ago by Janko Marohnić <[email protected]>
Document yielding content length when streaming

c86e35ea5002a1bb62ddd76bd67dd6bab6aab9a6 authored over 8 years ago by Janko Marohnić <[email protected]>
In linter chunks should sum up to content length

d438d608e30a46750d517d859f14b444cad67fb5 authored over 8 years ago by Janko Marohnić <[email protected]>
Prepare for version 1.4.0

8522fd84418aeffe7002f5bf7e65b86115a17d80 authored over 8 years ago by Janko Marohnić <[email protected]>
Remove deprecated keep_location from website

59ab22e6f0253a7269b44fcafe269998d4c05909 authored over 8 years ago by Janko Marohnić <[email protected]>
Give example of Attacher.dump and Attacher.load

4fa0fe875ada1bd11c3820b9ebf10161e75a6622 authored over 8 years ago by Janko Marohnić <[email protected]>
Rewind IO on top-level in metadata plugins

This way we don't have to repeat rewinding for every analyzer, and the
user doesn't have to reme...

62ccce4807540c78d476b7e15d2a21b05ec545e5 authored over 8 years ago by Janko Marohnić <[email protected]>
Random documentation improvements

We also document the delete_promoted plugin here, since we forgot to do
so before.

f68924a2fd1ecd11d3fc1e75064f974e3200f2ab authored over 8 years ago by Janko Marohnić <[email protected]>
Move before_* and after_* hooks around around_*

Current behaviour was that before_* and after_* hooks happen inside the
around_* hook, which mea...

fdd144261f8e3c66d5ee91d8b8c5697c34ea0ca5 authored over 8 years ago by Janko Marohnić <[email protected]>
Rename restore_cached to restore_cached_data

The "restore_cached" name indicates that somehow the cached file itself
is somehow restored. The...

03f4ef19361c44594cc699641e110237c1051294 authored over 8 years ago by Janko Marohnić <[email protected]>
Yield content length in Storage::S3#stream

This content length is used by the download_endpoint plugin to assign to
the Content-Length resp...

980580c8fa519762087840980e89ef5fc72cf461 authored over 8 years ago by Janko Marohnić <[email protected]>
Refactor, test, and improve storage linter

There are a lot of subtle things we're taking care of in the linter (in
order to work for differ...

c2870088106d218ca5223530990224701d5fb514 authored over 8 years ago by Janko Marohnić <[email protected]>
Some general cosmetic fixes

710b477cf4336527026a899d25666ca94290b8fe authored over 8 years ago by Janko Marohnić <[email protected]>
Don't error validations when dimensions are absent

If a user uploads something that isn't an image which you cannot extract
dimensions from, dimens...

c52c9ad8654bb233554c94ed40811c234e976596 authored over 8 years ago by Janko Marohnić <[email protected]>
Small refactoring and fixes

e8b1bf2e755a61b1b0d84f2a5c53a38f4e43a72f authored over 8 years ago by Janko Marohnić <[email protected]>
Link recent blog post on Sitepoint

77964dd518f62efd8181cdc78c3d9210ca60c232 authored over 8 years ago by Janko Marohnić <[email protected]>
Return Content-Length header in download_endpoint

Returning the Content-Length is really useful e.g. for downloading
files, where the browser can ...

7514a449a7c04d343aea7fe850c8cd0110c9fd22 authored over 8 years ago by Janko Marohnić <[email protected]>
Change parallelize plugin to use threads directly

Requiring a dependency just for a simple functionality of thread pools
is an overkill. So we swa...

14e930a45382e043e7f93ba6270e804e929056ec authored over 8 years ago by Janko Marohnić <[email protected]>
Correct option name in moving plugin

4a9c0dffc778a330696b16821aedcfd901309e2b authored over 8 years ago by Janko Marohnić <[email protected]>
Add :filename to data_uri for generating filenames

Generating a filename for an IO assigned through a data URI is useful
when we want the file to b...

6d4ade32ca99b30301d7f20de7f898a45428166d authored over 8 years ago by Janko Marohnić <[email protected]>
Make logging plugin correctly work with hooks

Currently if hooks plugin was loaded before logging, anything
user-defined inside those hooks wo...

4c8535bfb927552fda17dd974e5615bcee517bd3 authored over 8 years ago by Janko Marohnić <[email protected]>
Add :presign_location for generating key

It's useful to be able to generate the key yourself for presigned
uploads. A common use case is ...

e72dc43baadd31d9ef892f9bc90465065eeac707 authored over 8 years ago by Janko Marohnić <[email protected]>
Accept presign options via :presign_options

Instead of making the :presign option play a double role of choosing
presigns and setting presig...

da0d7d2d67e85d175a8e99c118e82d3b15cf4d00 authored over 8 years ago by Janko Marohnić <[email protected]>