cheesy-gallery 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +49 -49
- data/lib/cheesy-gallery/image_file.rb +17 -7
- data/lib/cheesy-gallery/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3e6e32ee6fa9990ede5645a8601244e46f7fd8adcbcc883861e71bc68a43489
|
4
|
+
data.tar.gz: 6fe038ea0cf31ccab0deaf6409095c527efd92fe4a2b8d2f8243d217bbe6dbcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d3d8d30543f19afa9ec01fe3b82be4520665c2ae40a4b008b9e3148166997b82c049dd5cd28bf321d00d0fda8b342a31960b1a7cc904cb5134067723ba290ec
|
7
|
+
data.tar.gz: 69535fa1df4de255e0941e573d2f3bc9b1db27074ec6312367759342b208c7f2087bd63c72f6343024f92cfe2ce9fe9ec200f36d11f9ad2f44459e7559d77485
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cheesy-gallery (0.
|
4
|
+
cheesy-gallery (0.6.0)
|
5
5
|
jekyll (~> 4.0)
|
6
6
|
rmagick (~> 4.0)
|
7
7
|
sorbet-runtime
|
@@ -11,109 +11,109 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
addressable (2.7.0)
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
|
-
ast (2.4.
|
15
|
-
codecov (0.
|
16
|
-
|
17
|
-
simplecov
|
14
|
+
ast (2.4.2)
|
15
|
+
codecov (0.5.1)
|
16
|
+
simplecov (>= 0.15, < 0.22)
|
18
17
|
coderay (1.1.3)
|
19
18
|
colorator (1.1.0)
|
20
|
-
concurrent-ruby (1.1.
|
19
|
+
concurrent-ruby (1.1.8)
|
21
20
|
diff-lcs (1.4.4)
|
22
|
-
docile (1.3.
|
23
|
-
em-websocket (0.5.
|
21
|
+
docile (1.3.5)
|
22
|
+
em-websocket (0.5.2)
|
24
23
|
eventmachine (>= 0.12.9)
|
25
24
|
http_parser.rb (~> 0.6.0)
|
26
25
|
eventmachine (1.2.7)
|
27
|
-
ffi (1.
|
26
|
+
ffi (1.14.2)
|
28
27
|
forwardable-extended (2.6.0)
|
29
28
|
http_parser.rb (0.6.0)
|
30
|
-
i18n (1.8.
|
29
|
+
i18n (1.8.9)
|
31
30
|
concurrent-ruby (~> 1.0)
|
32
|
-
jekyll (4.
|
31
|
+
jekyll (4.2.0)
|
33
32
|
addressable (~> 2.4)
|
34
33
|
colorator (~> 1.0)
|
35
34
|
em-websocket (~> 0.5)
|
36
35
|
i18n (~> 1.0)
|
37
36
|
jekyll-sass-converter (~> 2.0)
|
38
37
|
jekyll-watch (~> 2.0)
|
39
|
-
kramdown (~> 2.
|
38
|
+
kramdown (~> 2.3)
|
40
39
|
kramdown-parser-gfm (~> 1.0)
|
41
40
|
liquid (~> 4.0)
|
42
41
|
mercenary (~> 0.4.0)
|
43
42
|
pathutil (~> 0.9)
|
44
43
|
rouge (~> 3.0)
|
45
44
|
safe_yaml (~> 1.0)
|
46
|
-
terminal-table (~>
|
45
|
+
terminal-table (~> 2.0)
|
47
46
|
jekyll-sass-converter (2.1.0)
|
48
47
|
sassc (> 2.0.1, < 3.0)
|
49
48
|
jekyll-watch (2.2.1)
|
50
49
|
listen (~> 3.0)
|
51
|
-
json (2.3.1)
|
52
50
|
kramdown (2.3.0)
|
53
51
|
rexml
|
54
52
|
kramdown-parser-gfm (1.1.0)
|
55
53
|
kramdown (~> 2.0)
|
56
54
|
liquid (4.0.3)
|
57
|
-
listen (3.
|
55
|
+
listen (3.4.1)
|
58
56
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
59
57
|
rb-inotify (~> 0.9, >= 0.9.10)
|
60
58
|
mercenary (0.4.0)
|
61
59
|
method_source (1.0.0)
|
62
|
-
parallel (1.
|
63
|
-
parser (
|
60
|
+
parallel (1.20.1)
|
61
|
+
parser (3.0.0.0)
|
64
62
|
ast (~> 2.4.1)
|
65
63
|
pathutil (0.16.2)
|
66
64
|
forwardable-extended (~> 2.6)
|
67
|
-
pry (0.
|
65
|
+
pry (0.14.0)
|
68
66
|
coderay (~> 1.1)
|
69
67
|
method_source (~> 1.0)
|
70
|
-
public_suffix (4.0.
|
68
|
+
public_suffix (4.0.6)
|
71
69
|
rainbow (3.0.0)
|
72
|
-
rake (13.0.
|
70
|
+
rake (13.0.3)
|
73
71
|
rb-fsevent (0.10.4)
|
74
72
|
rb-inotify (0.10.1)
|
75
73
|
ffi (~> 1.0)
|
76
|
-
regexp_parser (1.
|
74
|
+
regexp_parser (2.1.1)
|
77
75
|
rexml (3.2.4)
|
78
|
-
rmagick (4.
|
79
|
-
rouge (3.
|
80
|
-
rspec (3.
|
81
|
-
rspec-core (~> 3.
|
82
|
-
rspec-expectations (~> 3.
|
83
|
-
rspec-mocks (~> 3.
|
84
|
-
rspec-core (3.
|
85
|
-
rspec-support (~> 3.
|
86
|
-
rspec-expectations (3.
|
76
|
+
rmagick (4.2.2)
|
77
|
+
rouge (3.26.0)
|
78
|
+
rspec (3.10.0)
|
79
|
+
rspec-core (~> 3.10.0)
|
80
|
+
rspec-expectations (~> 3.10.0)
|
81
|
+
rspec-mocks (~> 3.10.0)
|
82
|
+
rspec-core (3.10.1)
|
83
|
+
rspec-support (~> 3.10.0)
|
84
|
+
rspec-expectations (3.10.1)
|
87
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
|
-
rspec-support (~> 3.
|
89
|
-
rspec-mocks (3.
|
86
|
+
rspec-support (~> 3.10.0)
|
87
|
+
rspec-mocks (3.10.2)
|
90
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
91
|
-
rspec-support (~> 3.
|
92
|
-
rspec-support (3.
|
93
|
-
rubocop (
|
89
|
+
rspec-support (~> 3.10.0)
|
90
|
+
rspec-support (3.10.2)
|
91
|
+
rubocop (1.11.0)
|
94
92
|
parallel (~> 1.10)
|
95
|
-
parser (>=
|
93
|
+
parser (>= 3.0.0.0)
|
96
94
|
rainbow (>= 2.2.2, < 4.0)
|
97
|
-
regexp_parser (>= 1.
|
95
|
+
regexp_parser (>= 1.8, < 3.0)
|
98
96
|
rexml
|
99
|
-
rubocop-ast (>=
|
97
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
100
98
|
ruby-progressbar (~> 1.7)
|
101
|
-
unicode-display_width (>= 1.4.0, <
|
102
|
-
rubocop-ast (
|
103
|
-
parser (>= 2.7.1.
|
104
|
-
ruby-progressbar (1.
|
99
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
100
|
+
rubocop-ast (1.4.1)
|
101
|
+
parser (>= 2.7.1.5)
|
102
|
+
ruby-progressbar (1.11.0)
|
105
103
|
safe_yaml (1.0.5)
|
106
104
|
sassc (2.4.0)
|
107
105
|
ffi (~> 1.9)
|
108
|
-
simplecov (0.
|
106
|
+
simplecov (0.21.2)
|
109
107
|
docile (~> 1.1)
|
110
108
|
simplecov-html (~> 0.11)
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
sorbet
|
115
|
-
|
116
|
-
|
109
|
+
simplecov_json_formatter (~> 0.1)
|
110
|
+
simplecov-html (0.12.3)
|
111
|
+
simplecov_json_formatter (0.1.2)
|
112
|
+
sorbet (0.5.6317)
|
113
|
+
sorbet-static (= 0.5.6317)
|
114
|
+
sorbet-runtime (0.5.6317)
|
115
|
+
sorbet-static (0.5.6317-universal-darwin-14)
|
116
|
+
terminal-table (2.0.0)
|
117
117
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
118
118
|
unicode-display_width (1.7.0)
|
119
119
|
|
@@ -7,6 +7,8 @@ require 'cheesy-gallery/base_image_file'
|
|
7
7
|
# This StaticFile subclass adds additional functionality for images in the
|
8
8
|
# gallery
|
9
9
|
class CheesyGallery::ImageFile < CheesyGallery::BaseImageFile
|
10
|
+
@@geometry_cache = T.let(Jekyll::Cache.new('CheesyGallery::Geometry'), Jekyll::Cache) # don't need to worry about inheritance here # rubocop:disable Style/ClassVars
|
11
|
+
|
10
12
|
sig { params(site: Jekyll::Site, collection: Jekyll::Collection, file: Jekyll::StaticFile, max_size: String, quality: Integer).void }
|
11
13
|
def initialize(site, collection, file, max_size:, quality:)
|
12
14
|
super(site, collection, file)
|
@@ -14,14 +16,22 @@ class CheesyGallery::ImageFile < CheesyGallery::BaseImageFile
|
|
14
16
|
@max_size = T.let(max_size, String)
|
15
17
|
@quality = T.let(quality, Integer)
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
realpath = File.realdirpath(path)
|
20
|
+
mtime = File.mtime(realpath)
|
21
|
+
geom = @@geometry_cache.getset("#{realpath}##{mtime}") do
|
22
|
+
result = [100, 100]
|
23
|
+
# read file metadata in the same way it will be processed
|
24
|
+
Jekyll.logger.debug 'Identifying:', path
|
25
|
+
source = Magick::Image.ping(path).first
|
26
|
+
source.change_geometry!(@max_size) do |cols, rows, _img|
|
27
|
+
result = [rows, cols]
|
28
|
+
end
|
29
|
+
source.destroy!
|
30
|
+
result
|
23
31
|
end
|
24
|
-
|
32
|
+
|
33
|
+
data['height'] = geom[0]
|
34
|
+
data['width'] = geom[1]
|
25
35
|
end
|
26
36
|
|
27
37
|
# instead of copying, renders an optimised version
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheesy-gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Schmitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.
|
207
|
+
rubygems_version: 3.2.5
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: A jekyll plugin for building galleries.
|