kamifusen 0.9.6 → 1.3

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: a689acadb87e346abfda6e357a1de05daf496622275dacc35d4b1f4c3464f3f9
4
- data.tar.gz: e21c4b4e6048ea0ba35709bfad5b364e2292ac9cbb7767c655b51d2913e63fd8
3
+ metadata.gz: eac96058e579f9ae629576bd126de9042b25ab3faffc7b99dfa875944d576239
4
+ data.tar.gz: e8480cdec01a138f28b8a725492b99a50d41c1ae107e59c4e41544bf61b4b1d5
5
5
  SHA512:
6
- metadata.gz: d44f3179b6a02b35c880d083a9b8a4232ee14e01564ef29017a45430f0acfcac328fac44b5d374dd32ecbb69de4ebd5e463d9351279404fabe5840126352c7a4
7
- data.tar.gz: 46501974677fab6ae5749705991dded8bdfddd0b223e76b8eea9048eb67ee642f942ad99df046bd26e57f4728d38e7c7684faea09cfa75f1a0b7fdc19d48e6b4
6
+ metadata.gz: 2d3d568386dfb35f13a820c8b6d4ec7a0381958dc1cc387932f844c50deeb40f6afd3c9041edfb4222d5506ef358dc837f3709a22fac6ba28d5169b51efe1be9
7
+ data.tar.gz: 43ec54add0ff08ec20ba708db5c3de12555c2d260e17314696ee6ac2c7bc3957912e800fdfbea66412883375dbcc9d1ea8f932c4b36dff34ddd59c22081938a5
data/Gemfile CHANGED
@@ -8,3 +8,5 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
 
10
10
  gem "rubocop", "~> 1.7"
11
+
12
+ gem "byebug"
data/Gemfile.lock CHANGED
@@ -1,67 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kamifusen (0.9.6)
4
+ kamifusen (1.3)
5
5
  image_processing
6
6
  rails
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.1.3.2)
12
- actionpack (= 6.1.3.2)
13
- activesupport (= 6.1.3.2)
11
+ actioncable (6.1.4)
12
+ actionpack (= 6.1.4)
13
+ activesupport (= 6.1.4)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
- actionmailbox (6.1.3.2)
17
- actionpack (= 6.1.3.2)
18
- activejob (= 6.1.3.2)
19
- activerecord (= 6.1.3.2)
20
- activestorage (= 6.1.3.2)
21
- activesupport (= 6.1.3.2)
16
+ actionmailbox (6.1.4)
17
+ actionpack (= 6.1.4)
18
+ activejob (= 6.1.4)
19
+ activerecord (= 6.1.4)
20
+ activestorage (= 6.1.4)
21
+ activesupport (= 6.1.4)
22
22
  mail (>= 2.7.1)
23
- actionmailer (6.1.3.2)
24
- actionpack (= 6.1.3.2)
25
- actionview (= 6.1.3.2)
26
- activejob (= 6.1.3.2)
27
- activesupport (= 6.1.3.2)
23
+ actionmailer (6.1.4)
24
+ actionpack (= 6.1.4)
25
+ actionview (= 6.1.4)
26
+ activejob (= 6.1.4)
27
+ activesupport (= 6.1.4)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.1.3.2)
31
- actionview (= 6.1.3.2)
32
- activesupport (= 6.1.3.2)
30
+ actionpack (6.1.4)
31
+ actionview (= 6.1.4)
32
+ activesupport (= 6.1.4)
33
33
  rack (~> 2.0, >= 2.0.9)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.1.3.2)
38
- actionpack (= 6.1.3.2)
39
- activerecord (= 6.1.3.2)
40
- activestorage (= 6.1.3.2)
41
- activesupport (= 6.1.3.2)
37
+ actiontext (6.1.4)
38
+ actionpack (= 6.1.4)
39
+ activerecord (= 6.1.4)
40
+ activestorage (= 6.1.4)
41
+ activesupport (= 6.1.4)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.1.3.2)
44
- activesupport (= 6.1.3.2)
43
+ actionview (6.1.4)
44
+ activesupport (= 6.1.4)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.1.3.2)
50
- activesupport (= 6.1.3.2)
49
+ activejob (6.1.4)
50
+ activesupport (= 6.1.4)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.1.3.2)
53
- activesupport (= 6.1.3.2)
54
- activerecord (6.1.3.2)
55
- activemodel (= 6.1.3.2)
56
- activesupport (= 6.1.3.2)
57
- activestorage (6.1.3.2)
58
- actionpack (= 6.1.3.2)
59
- activejob (= 6.1.3.2)
60
- activerecord (= 6.1.3.2)
61
- activesupport (= 6.1.3.2)
52
+ activemodel (6.1.4)
53
+ activesupport (= 6.1.4)
54
+ activerecord (6.1.4)
55
+ activemodel (= 6.1.4)
56
+ activesupport (= 6.1.4)
57
+ activestorage (6.1.4)
58
+ actionpack (= 6.1.4)
59
+ activejob (= 6.1.4)
60
+ activerecord (= 6.1.4)
61
+ activesupport (= 6.1.4)
62
62
  marcel (~> 1.0.0)
63
- mini_mime (~> 1.0.2)
64
- activesupport (6.1.3.2)
63
+ mini_mime (>= 1.1.0)
64
+ activesupport (6.1.4)
65
65
  concurrent-ruby (~> 1.0, >= 1.0.2)
66
66
  i18n (>= 1.6, < 2)
67
67
  minitest (>= 5.1)
@@ -69,10 +69,11 @@ GEM
69
69
  zeitwerk (~> 2.3)
70
70
  ast (2.4.2)
71
71
  builder (3.2.4)
72
- concurrent-ruby (1.1.8)
72
+ byebug (11.1.3)
73
+ concurrent-ruby (1.1.9)
73
74
  crass (1.0.6)
74
75
  erubi (1.10.0)
75
- ffi (1.15.0)
76
+ ffi (1.15.3)
76
77
  globalid (0.4.2)
77
78
  activesupport (>= 4.2.0)
78
79
  i18n (1.8.10)
@@ -83,7 +84,7 @@ GEM
83
84
  listen (3.5.1)
84
85
  rb-fsevent (~> 0.10, >= 0.10.3)
85
86
  rb-inotify (~> 0.9, >= 0.9.10)
86
- loofah (2.9.1)
87
+ loofah (2.10.0)
87
88
  crass (~> 1.0.2)
88
89
  nokogiri (>= 1.5.9)
89
90
  mail (2.7.1)
@@ -91,10 +92,12 @@ GEM
91
92
  marcel (1.0.1)
92
93
  method_source (1.0.0)
93
94
  mini_magick (4.11.0)
94
- mini_mime (1.0.3)
95
+ mini_mime (1.1.0)
96
+ mini_portile2 (2.5.3)
95
97
  minitest (5.14.4)
96
98
  nio4r (2.5.7)
97
- nokogiri (1.11.6-x86_64-darwin)
99
+ nokogiri (1.11.7)
100
+ mini_portile2 (~> 2.5.0)
98
101
  racc (~> 1.4)
99
102
  parallel (1.20.1)
100
103
  parser (3.0.1.1)
@@ -103,31 +106,31 @@ GEM
103
106
  rack (2.2.3)
104
107
  rack-test (1.1.0)
105
108
  rack (>= 1.0, < 3)
106
- rails (6.1.3.2)
107
- actioncable (= 6.1.3.2)
108
- actionmailbox (= 6.1.3.2)
109
- actionmailer (= 6.1.3.2)
110
- actionpack (= 6.1.3.2)
111
- actiontext (= 6.1.3.2)
112
- actionview (= 6.1.3.2)
113
- activejob (= 6.1.3.2)
114
- activemodel (= 6.1.3.2)
115
- activerecord (= 6.1.3.2)
116
- activestorage (= 6.1.3.2)
117
- activesupport (= 6.1.3.2)
109
+ rails (6.1.4)
110
+ actioncable (= 6.1.4)
111
+ actionmailbox (= 6.1.4)
112
+ actionmailer (= 6.1.4)
113
+ actionpack (= 6.1.4)
114
+ actiontext (= 6.1.4)
115
+ actionview (= 6.1.4)
116
+ activejob (= 6.1.4)
117
+ activemodel (= 6.1.4)
118
+ activerecord (= 6.1.4)
119
+ activestorage (= 6.1.4)
120
+ activesupport (= 6.1.4)
118
121
  bundler (>= 1.15.0)
119
- railties (= 6.1.3.2)
122
+ railties (= 6.1.4)
120
123
  sprockets-rails (>= 2.0.0)
121
124
  rails-dom-testing (2.0.3)
122
125
  activesupport (>= 4.2.0)
123
126
  nokogiri (>= 1.6)
124
127
  rails-html-sanitizer (1.3.0)
125
128
  loofah (~> 2.3)
126
- railties (6.1.3.2)
127
- actionpack (= 6.1.3.2)
128
- activesupport (= 6.1.3.2)
129
+ railties (6.1.4)
130
+ actionpack (= 6.1.4)
131
+ activesupport (= 6.1.4)
129
132
  method_source
130
- rake (>= 0.8.7)
133
+ rake (>= 0.13)
131
134
  thor (~> 1.0)
132
135
  rainbow (3.0.0)
133
136
  rake (13.0.3)
@@ -136,16 +139,16 @@ GEM
136
139
  ffi (~> 1.0)
137
140
  regexp_parser (2.1.1)
138
141
  rexml (3.2.5)
139
- rubocop (1.15.0)
142
+ rubocop (1.18.2)
140
143
  parallel (~> 1.10)
141
144
  parser (>= 3.0.0.0)
142
145
  rainbow (>= 2.2.2, < 4.0)
143
146
  regexp_parser (>= 1.8, < 3.0)
144
147
  rexml
145
- rubocop-ast (>= 1.5.0, < 2.0)
148
+ rubocop-ast (>= 1.7.0, < 2.0)
146
149
  ruby-progressbar (~> 1.7)
147
150
  unicode-display_width (>= 1.4.0, < 3.0)
148
- rubocop-ast (1.5.0)
151
+ rubocop-ast (1.7.0)
149
152
  parser (>= 3.0.1.1)
150
153
  ruby-progressbar (1.11.0)
151
154
  ruby-vips (2.1.2)
@@ -162,15 +165,17 @@ GEM
162
165
  tzinfo (2.0.4)
163
166
  concurrent-ruby (~> 1.0)
164
167
  unicode-display_width (2.0.0)
165
- websocket-driver (0.7.4)
168
+ websocket-driver (0.7.5)
166
169
  websocket-extensions (>= 0.1.0)
167
170
  websocket-extensions (0.1.5)
168
171
  zeitwerk (2.4.2)
169
172
 
170
173
  PLATFORMS
174
+ ruby
171
175
  x86_64-darwin-20
172
176
 
173
177
  DEPENDENCIES
178
+ byebug
174
179
  kamifusen!
175
180
  listen
176
181
  rake (~> 13.0)
@@ -5,6 +5,7 @@ alt = options[:alt]
5
5
  width = options[:width]
6
6
  height = options[:height]
7
7
  klass = options[:class]
8
+ picture_class = options[:picture_class]
8
9
  parameters = " loading=\"lazy\" decoding=\"async\""
9
10
  parameters += " alt=\"#{ options[:alt] }\"" if alt
10
11
  parameters += " width=\"#{ options[:width] }\"" if width
@@ -17,7 +18,14 @@ parameters += " class=\"#{ options[:class] }\"" if klass
17
18
  sizes = [320, 576, 640, 768, 992, 1152, 1200, 1400, 1536, 1984, 2400]
18
19
  quality = 80
19
20
  # Computing
20
- sizes.reject! { |size| size > width * 2 } if width
21
+ if width
22
+ width_retina = width * 2
23
+ sizes.reject! { |size| size > width_retina }
24
+ sizes << width_retina
25
+ sizes.uniq!
26
+ end
27
+ default_width = sizes.max
28
+ default_width = width_retina if width_retina && width_retina > default_width
21
29
  if Kamifusen.with_webp
22
30
  srcset_webp = sizes.map { |size|
23
31
  "#{ url_for source.variant(resize: "#{size}>", format: :webp, quality: quality) } #{ size }w"
@@ -26,16 +34,16 @@ parameters += " class=\"#{ options[:class] }\"" if klass
26
34
  srcset_default = sizes.map { |size|
27
35
  "#{ url_for source.variant(resize: "#{size}>", quality: quality) } #{ size }w"
28
36
  }.join(', ')
29
- default = url_for source.variant(resize: "#{sizes.max}>", quality: quality)
37
+ default = url_for source.variant(resize: "#{default_width}>", quality: quality)
30
38
  %>
31
- <picture>
39
+ <picture<%= " class=\"#{picture_class}\"".html_safe unless picture_class.blank? %>>
32
40
  <% if Kamifusen.with_webp %>
33
- <source srcset="<%= srcset_webp %>">
41
+ <source srcset="<%= srcset_webp %>" type="image/webp">
34
42
  <% end %>
35
- <img src="<%= default %>" srcset="<%= srcset_default %>"<%= raw parameters %>>
43
+ <img src="<%= default %>" srcset="<%= srcset_default %>" type="<%= source.content_type %>"<%= raw parameters %>>
36
44
  </picture>
37
45
  <% else %>
38
46
  <picture>
39
- <img src="<%= url_for source %>"<%= raw parameters %>>
47
+ <img src="<%= url_for source %>" type="<%= source.content_type %>"<%= raw parameters %>>
40
48
  </picture>
41
49
  <% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kamifusen
4
- VERSION = "0.9.6"
4
+ VERSION = "1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamifusen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Moulène
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-06-01 00:00:00.000000000 Z
12
+ date: 2021-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.1.4
119
+ rubygems_version: 3.1.6
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Images, light as balloons