cheesy-gallery 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2dc0d1b0518ec5f9babfd8ac91c4c602cdedf7408761f481c9b7651bb1f6cc2
4
- data.tar.gz: f3ba017868795eabf9f7426081c277cc86bd63e5e9921ad206ab0577db2be738
3
+ metadata.gz: b3e6e32ee6fa9990ede5645a8601244e46f7fd8adcbcc883861e71bc68a43489
4
+ data.tar.gz: 6fe038ea0cf31ccab0deaf6409095c527efd92fe4a2b8d2f8243d217bbe6dbcb
5
5
  SHA512:
6
- metadata.gz: 65954e185f7d3220273d277ad6c108e37f429f683ec3bc3a65983ada225e3a4a47e27d0ef4e30489cc4e549b2b4866f7c12858212facb104426e9b8484e96f98
7
- data.tar.gz: fb8a7bd3428de2da5e7920eb6d9084035cb68d7acfbf3f242f8a95feacaff749c4e9d4e835e2a09f1c4aeae60dbfa0bfa5c12ebbc0b7fce9d6f1ebe74abfeac2
6
+ metadata.gz: 1d3d8d30543f19afa9ec01fe3b82be4520665c2ae40a4b008b9e3148166997b82c049dd5cd28bf321d00d0fda8b342a31960b1a7cc904cb5134067723ba290ec
7
+ data.tar.gz: 69535fa1df4de255e0941e573d2f3bc9b1db27074ec6312367759342b208c7f2087bd63c72f6343024f92cfe2ce9fe9ec200f36d11f9ad2f44459e7559d77485
data/.travis.yml CHANGED
@@ -16,7 +16,7 @@ install: bundle install
16
16
 
17
17
  jobs:
18
18
  include:
19
- - env: CHECK=rspec
19
+ - env: CHECK=ruby
20
20
  script:
21
21
  - bundle exec rake
22
22
  - env: CHECK=sorbet
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cheesy-gallery (0.5.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.1)
15
- codecov (0.2.8)
16
- json
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.7)
19
+ concurrent-ruby (1.1.8)
21
20
  diff-lcs (1.4.4)
22
- docile (1.3.2)
23
- em-websocket (0.5.1)
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.13.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.5)
29
+ i18n (1.8.9)
31
30
  concurrent-ruby (~> 1.0)
32
- jekyll (4.1.1)
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.1)
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 (~> 1.8)
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.2.1)
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.19.2)
63
- parser (2.7.1.4)
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.13.1)
65
+ pry (0.14.0)
68
66
  coderay (~> 1.1)
69
67
  method_source (~> 1.0)
70
- public_suffix (4.0.5)
68
+ public_suffix (4.0.6)
71
69
  rainbow (3.0.0)
72
- rake (13.0.1)
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.7.1)
74
+ regexp_parser (2.1.1)
77
75
  rexml (3.2.4)
78
- rmagick (4.1.2)
79
- rouge (3.22.0)
80
- rspec (3.9.0)
81
- rspec-core (~> 3.9.0)
82
- rspec-expectations (~> 3.9.0)
83
- rspec-mocks (~> 3.9.0)
84
- rspec-core (3.9.2)
85
- rspec-support (~> 3.9.3)
86
- rspec-expectations (3.9.2)
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.9.0)
89
- rspec-mocks (3.9.1)
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.9.0)
92
- rspec-support (3.9.3)
93
- rubocop (0.89.1)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-support (3.10.2)
91
+ rubocop (1.11.0)
94
92
  parallel (~> 1.10)
95
- parser (>= 2.7.1.1)
93
+ parser (>= 3.0.0.0)
96
94
  rainbow (>= 2.2.2, < 4.0)
97
- regexp_parser (>= 1.7)
95
+ regexp_parser (>= 1.8, < 3.0)
98
96
  rexml
99
- rubocop-ast (>= 0.3.0, < 1.0)
97
+ rubocop-ast (>= 1.2.0, < 2.0)
100
98
  ruby-progressbar (~> 1.7)
101
- unicode-display_width (>= 1.4.0, < 2.0)
102
- rubocop-ast (0.3.0)
103
- parser (>= 2.7.1.4)
104
- ruby-progressbar (1.10.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.19.0)
106
+ simplecov (0.21.2)
109
107
  docile (~> 1.1)
110
108
  simplecov-html (~> 0.11)
111
- simplecov-html (0.12.2)
112
- sorbet (0.5.5879)
113
- sorbet-static (= 0.5.5879)
114
- sorbet-runtime (0.5.5883)
115
- sorbet-static (0.5.5879-universal-darwin-14)
116
- terminal-table (1.8.0)
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
- # read file metadata in the same way it will be processed
18
- Jekyll.logger.debug 'Identifying:', path
19
- source = Magick::Image.ping(path).first
20
- source.change_geometry!(@max_size) do |cols, rows, _img|
21
- data['height'] = rows
22
- data['width'] = cols
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
- source.destroy!
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
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module CheesyGallery
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
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.5.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: 2020-09-01 00:00:00.000000000 Z
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.1.2
207
+ rubygems_version: 3.2.5
208
208
  signing_key:
209
209
  specification_version: 4
210
210
  summary: A jekyll plugin for building galleries.