-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathimage_optim_pack.gemspec
62 lines (50 loc) · 2.18 KB
/
image_optim_pack.gemspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# encoding: UTF-8
Gem::Specification.new do |s|
s.name = 'image_optim_pack'
s.version = '0.11.1.20250125'
s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, oxipng, pngcrush, pngout, pngquant}
s.homepage = "https://github.com/toy/#{s.name}"
s.authors = ['Ivan Kuchin']
s.license = 'MIT'
s.required_ruby_version = '>= 1.9.3'
s.metadata = {
'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
'changelog_uri' => "https://github.com/toy/#{s.name}/blob/master/CHANGELOG.markdown",
'documentation_uri' => "https://www.rubydoc.info/gems/#{s.name}/#{s.version}",
'source_code_uri' => "https://github.com/toy/#{s.name}",
}
s.files = `git ls-files`.split("\n")
if defined?(gemspec_path)
gem_os, gem_cpu = File.basename(gemspec_path, File.extname(gemspec_path)).split('-').drop(1)
s.platform = Gem::Platform.new([gem_cpu, gem_os])
cpu_aliases = {
'x86_64' => %w[x86_64 amd64],
}[gem_cpu] || [gem_cpu]
possible_vendor_dirs = cpu_aliases.map do |cpu_alias|
"#{gem_os}-#{cpu_alias}"
end
existing_vendor_dirs = possible_vendor_dirs.select do |vendor_dir|
File.directory?(File.join('vendor', vendor_dir))
end
vendor_dir = if existing_vendor_dirs.length == 1
existing_vendor_dirs.first
else
message = existing_vendor_dirs.empty? ? 'no vendor dir' : 'multiple vendor dirs'
fail "#{message} found for os #{gem_os} and cpu #{gem_cpu} out of: #{possible_vendor_dirs.join(', ')}"
end
s.files.reject! do |path|
parts = path.split('/')
parts[0] == 'vendor' && parts[1] != vendor_dir
end
end
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = %w[lib]
s.add_dependency 'image_optim', '~> 0.19'
s.add_dependency 'fspath', '>= 2.1', '< 4'
s.add_development_dependency 'rspec', '~> 3.0'
if RUBY_VERSION >= '2.5'
s.add_development_dependency 'rubocop', '~> 1.22', '!= 1.22.2'
s.add_development_dependency 'rubocop-rspec', '~> 2.0'
end
end