Compare commits
No commits in common. "master" and "v1.0.1" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,4 +7,3 @@
|
|||||||
/spec/reports/
|
/spec/reports/
|
||||||
/tmp/
|
/tmp/
|
||||||
.rspec_status
|
.rspec_status
|
||||||
*.gem
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
manifique (1.1.0)
|
manifique (1.0.0)
|
||||||
faraday (~> 2.9.0)
|
faraday (~> 2.9.0)
|
||||||
faraday-follow_redirects (= 0.3.0)
|
faraday-follow_redirects (= 0.3.0)
|
||||||
nokogiri (~> 1.16.0)
|
nokogiri (~> 1.16.0)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
[](https://rubygems.org/gems/manifique)
|
|
||||||
[](https://drone.kosmos.org/5apps/manifique)
|
[](https://drone.kosmos.org/5apps/manifique)
|
||||||
|
|
||||||
# Manifique
|
# Manifique
|
||||||
|
@ -43,17 +43,11 @@ module Manifique
|
|||||||
end
|
end
|
||||||
|
|
||||||
if options[:type]
|
if options[:type]
|
||||||
if options[:type].is_a?(String)
|
results.reject! { |r| r["type"] != options[:type] }
|
||||||
results.reject! { |r| r["type"] != options[:type] }
|
|
||||||
elsif options[:type].is_a?(Regexp)
|
|
||||||
results.reject! { |r| r["type"].match(options[:type]).nil? }
|
|
||||||
else
|
|
||||||
raise ArgumentError, "Type must be a string or a regular expression"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if options[:sizes]
|
if options[:sizes]
|
||||||
results.reject! { |r| r["sizes"].nil? || r["sizes"].match(/(\d+)x/).nil? }
|
results.reject! { |r| r["sizes"].nil? }
|
||||||
results.sort! { |a, b| sizes_to_i(b["sizes"]) <=> sizes_to_i(a["sizes"]) }
|
results.sort! { |a, b| sizes_to_i(b["sizes"]) <=> sizes_to_i(a["sizes"]) }
|
||||||
|
|
||||||
if icon = select_exact_size(results, options[:sizes])
|
if icon = select_exact_size(results, options[:sizes])
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
module Manifique
|
module Manifique
|
||||||
VERSION = "1.1.0"
|
VERSION = "1.0.1"
|
||||||
end
|
end
|
||||||
|
@ -68,16 +68,6 @@ RSpec.describe Manifique::Metadata do
|
|||||||
icon = metadata.select_icon(type: "image/png")
|
icon = metadata.select_icon(type: "image/png")
|
||||||
expect(icon["sizes"]).to eq("512x512")
|
expect(icon["sizes"]).to eq("512x512")
|
||||||
end
|
end
|
||||||
|
|
||||||
it "matches strings exactly" do
|
|
||||||
icon = metadata.select_icon(type: "image/svg")
|
|
||||||
expect(icon["type"]).to eq("image/svg")
|
|
||||||
end
|
|
||||||
|
|
||||||
it "works with a regex" do
|
|
||||||
icon = metadata.select_icon(type: /image\/svg/)
|
|
||||||
expect(icon["type"]).to eq("image/svg+xml")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "by size" do
|
describe "by size" do
|
||||||
@ -115,7 +105,6 @@ def icon_fixtures
|
|||||||
{"src"=>"/application_icon_x228.png", "sizes"=>"228x228", "type"=>"image/png"},
|
{"src"=>"/application_icon_x228.png", "sizes"=>"228x228", "type"=>"image/png"},
|
||||||
{"src"=>"/application_icon_x196.png", "sizes"=>"196x196", "type"=>"image/png"},
|
{"src"=>"/application_icon_x196.png", "sizes"=>"196x196", "type"=>"image/png"},
|
||||||
{"src"=>"/application_icon_x192.png", "sizes"=>"192x192", "type"=>"image/png"},
|
{"src"=>"/application_icon_x192.png", "sizes"=>"192x192", "type"=>"image/png"},
|
||||||
{"src"=>"/icon-maskable.svg", "type"=>"image/svg+xml", "sizes"=>"any", "purpose"=>"maskable"},
|
|
||||||
{"purpose"=>"apple-touch-icon", "src"=>"/apple-touch-icon.png", "sizes"=>"180x180", "type"=>"image/png" },
|
{"purpose"=>"apple-touch-icon", "src"=>"/apple-touch-icon.png", "sizes"=>"180x180", "type"=>"image/png" },
|
||||||
{"purpose"=>"apple-touch-icon", "src"=>"/apple-touch-icon-57px.png", "sizes"=>"57x57", "type"=>"image/png"},
|
{"purpose"=>"apple-touch-icon", "src"=>"/apple-touch-icon-57px.png", "sizes"=>"57x57", "type"=>"image/png"},
|
||||||
{"purpose"=>"mask-icon", "src"=>"/mask-icon.svg", "type"=>"image/svg", "color"=>"#2b90d9"}
|
{"purpose"=>"mask-icon", "src"=>"/mask-icon.svg", "type"=>"image/svg", "color"=>"#2b90d9"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user