next_gen_images 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -9
- data/README.md +1 -1
- data/lib/next_gen_images/version.rb +1 -1
- data/lib/next_gen_images/view_helpers.rb +4 -4
- data/lib/next_gen_images.rb +2 -0
- data/next_gen_images.gemspec +40 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f92dcb3e7a5dc2c7e613431683190de72b6aea0b2044b6a216ab40185659155
|
4
|
+
data.tar.gz: ecd61c0cce652c8f8d2cdfd6185056df9252d545741e2cdd5deb44ca9139954e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb48b10ae8d6b9d8b02813436e433f1574619d45a8c1b623174df1063ecbd42e96d08204539d497413ad9c6351c28e172e688df590afaf27b4d39d381b2d219a
|
7
|
+
data.tar.gz: a434d1d4d118cc4f8547c328d806210c98e6ff9981901da407fa06e9bbdd59c9e9fc85b8d11f595f2ad9a74048b327d6fc3b28f5ea257f9fcab2be8056d190cf
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
next_gen_images (1.
|
4
|
+
next_gen_images (1.1.1)
|
5
5
|
rails (>= 3.1)
|
6
6
|
webp-ffi (~> 0.3.1)
|
7
7
|
|
@@ -102,9 +102,9 @@ GEM
|
|
102
102
|
mini_magick (>= 4.9.5, < 5)
|
103
103
|
ruby-vips (>= 2.0.17, < 3)
|
104
104
|
json (2.6.2)
|
105
|
-
loofah (2.
|
105
|
+
loofah (2.21.3)
|
106
106
|
crass (~> 1.0.2)
|
107
|
-
nokogiri (>= 1.
|
107
|
+
nokogiri (>= 1.12.0)
|
108
108
|
mail (2.8.1)
|
109
109
|
mini_mime (>= 0.1.1)
|
110
110
|
net-imap
|
@@ -125,16 +125,14 @@ GEM
|
|
125
125
|
net-smtp (0.3.3)
|
126
126
|
net-protocol
|
127
127
|
nio4r (2.5.9)
|
128
|
-
nokogiri (1.
|
129
|
-
racc (~> 1.4)
|
130
|
-
nokogiri (1.14.3-x86_64-linux)
|
128
|
+
nokogiri (1.15.2-arm64-darwin)
|
131
129
|
racc (~> 1.4)
|
132
130
|
parallel (1.22.1)
|
133
131
|
parser (3.1.2.1)
|
134
132
|
ast (~> 2.4.1)
|
135
133
|
public_suffix (5.0.1)
|
136
134
|
racc (1.6.2)
|
137
|
-
rack (2.2.
|
135
|
+
rack (2.2.7)
|
138
136
|
rack-test (2.1.0)
|
139
137
|
rack (>= 1.3)
|
140
138
|
rails (7.0.4)
|
@@ -198,7 +196,7 @@ GEM
|
|
198
196
|
ruby-vips (2.1.4)
|
199
197
|
ffi (~> 1.12)
|
200
198
|
ssrf_filter (1.1.1)
|
201
|
-
thor (1.2.
|
199
|
+
thor (1.2.2)
|
202
200
|
timeout (0.3.2)
|
203
201
|
tzinfo (2.0.5)
|
204
202
|
concurrent-ruby (~> 1.0)
|
@@ -209,7 +207,7 @@ GEM
|
|
209
207
|
websocket-driver (0.7.5)
|
210
208
|
websocket-extensions (>= 0.1.0)
|
211
209
|
websocket-extensions (0.1.5)
|
212
|
-
zeitwerk (2.6.
|
210
|
+
zeitwerk (2.6.8)
|
213
211
|
|
214
212
|
PLATFORMS
|
215
213
|
arm64-darwin-21
|
data/README.md
CHANGED
@@ -31,13 +31,13 @@ module NextGenImages
|
|
31
31
|
|
32
32
|
content = ''.html_safe
|
33
33
|
if block.present?
|
34
|
-
content
|
34
|
+
content << capture(&block).html_safe
|
35
35
|
else
|
36
36
|
[source].flatten.each do |img_src|
|
37
|
-
content
|
37
|
+
content << build_source_from_img(image_path(img_src), add_webp)
|
38
38
|
end
|
39
39
|
end
|
40
|
-
content
|
40
|
+
content << tag('img', image_options)
|
41
41
|
end
|
42
42
|
|
43
43
|
def build_img_src(source)
|
@@ -56,7 +56,7 @@ module NextGenImages
|
|
56
56
|
webp_path = "#{img_path}.webp"
|
57
57
|
# order of source tags matters
|
58
58
|
if add_webp && file_exist_in_public_path?(webp_path)
|
59
|
-
source_tags
|
59
|
+
source_tags << source_tag(srcset: webp_path, type: 'image/webp')
|
60
60
|
end
|
61
61
|
source_tags + source_tag(
|
62
62
|
srcset: img_path,
|
data/lib/next_gen_images.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/next_gen_images/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'next_gen_images'
|
7
|
+
spec.version = NextGenImages::VERSION
|
8
|
+
spec.authors = ['JP Balarini']
|
9
|
+
spec.email = ['jp@eagerworks.com']
|
10
|
+
|
11
|
+
spec.summary = 'Handle next-gen image formats in your Ruby on Rails project. WebP is currently supported'
|
12
|
+
spec.description = 'Adds support for a picture_tag and several utilities to automatically convert images to WebP'
|
13
|
+
spec.homepage = 'https://eagerworks.com'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = '>= 2.6.0'
|
16
|
+
|
17
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/eagerworks/next_gen_images'
|
21
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(__dir__) do
|
26
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
spec.bindir = 'exe'
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ['lib']
|
33
|
+
|
34
|
+
spec.add_runtime_dependency 'rails', '>= 3.1'
|
35
|
+
spec.add_runtime_dependency 'webp-ffi', '~> 0.3.1'
|
36
|
+
spec.add_development_dependency 'bundler'
|
37
|
+
spec.add_development_dependency 'carrierwave', '>= 2.0'
|
38
|
+
spec.add_development_dependency 'rspec', '~> 3.12.0'
|
39
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.17.1'
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: next_gen_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Balarini
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- lib/next_gen_images/tasks/assets/webp.rake
|
117
117
|
- lib/next_gen_images/version.rb
|
118
118
|
- lib/next_gen_images/view_helpers.rb
|
119
|
+
- next_gen_images.gemspec
|
119
120
|
- sig/next_gen_images.rbs
|
120
121
|
homepage: https://eagerworks.com
|
121
122
|
licenses:
|