shrine-thumbhash 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Rakefile +1 -1
- data/lib/shrine/plugins/thumbhash/version.rb +1 -1
- data/lib/shrine/plugins/thumbhash.rb +9 -1
- data/shrine-thumbhash.gemspec +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8aaf148c08e609fb95032fca0a7e0157de3c6c858bdce559819468422c3668
|
4
|
+
data.tar.gz: 389d08019c08d1f7342ab1697a99d8e7470f7ef0e2c123357a82799be6589969
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a935af3b347713b2cc5005fc2eee91dfc359f6d43f86666090405f7a537facc2b4f91475de633547d70517b59bb1994364789577967889e2160bb7c6584a51
|
7
|
+
data.tar.gz: 3003658026f984a4d96bec4537101ff28b002e6cb77a766d66bb66ff9c3495a103c1322330be7f348458783d2bda7493de71fa24063bffda2657b17fb937823c
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -6,6 +6,10 @@ require "thumbhash"
|
|
6
6
|
class Shrine # :nodoc:
|
7
7
|
module Plugins # :nodoc:
|
8
8
|
module Thumbhash # :nodoc:
|
9
|
+
IMAGE_LOADER_CHOICES = [
|
10
|
+
:ruby_vips,
|
11
|
+
:mini_magick
|
12
|
+
].freeze
|
9
13
|
DEFAULT_OPTIONS = {
|
10
14
|
padding: true,
|
11
15
|
image_loader: :ruby_vips
|
@@ -14,7 +18,11 @@ class Shrine # :nodoc:
|
|
14
18
|
def self.configure(uploader, **opts)
|
15
19
|
uploader.opts[:thumbhash] ||= DEFAULT_OPTIONS.dup
|
16
20
|
uploader.opts[:thumbhash].merge!(opts)
|
17
|
-
|
21
|
+
image_loader_option = uploader.opts[:thumbhash][:image_loader]
|
22
|
+
|
23
|
+
return unless IMAGE_LOADER_CHOICES.include?(image_loader_option)
|
24
|
+
|
25
|
+
configure_image_loader(uploader.opts[:thumbhash])
|
18
26
|
end
|
19
27
|
|
20
28
|
def self.configure_image_loader(opts)
|
data/shrine-thumbhash.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.version = Shrine::Plugins::Thumbhash::VERSION
|
8
8
|
spec.authors = ["takayamaki / fusagiko"]
|
9
9
|
spec.email = ["24884114+takayamaki@users.noreply.github.com"]
|
10
|
+
spec.license = "MIT"
|
10
11
|
|
11
12
|
spec.summary = "Shrine plugin for generate Thumbhash from image attachments"
|
12
13
|
spec.homepage = "https://github.com/takayamaki/shrine-thumbhash"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shrine-thumbhash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- takayamaki / fusagiko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shrine
|
@@ -59,7 +59,8 @@ files:
|
|
59
59
|
- shrine-thumbhash.gemspec
|
60
60
|
- sig/shrine/plugins/thumbhash.rbs
|
61
61
|
homepage: https://github.com/takayamaki/shrine-thumbhash
|
62
|
-
licenses:
|
62
|
+
licenses:
|
63
|
+
- MIT
|
63
64
|
metadata:
|
64
65
|
allowed_push_host: https://rubygems.org
|
65
66
|
homepage_uri: https://github.com/takayamaki/shrine-thumbhash
|