Compare commits
4 Commits
e1d514d905
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
ac5a17dbb8
|
|||
|
784543f32d
|
|||
| a070bb6a49 | |||
|
682f66f476
|
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
manifique (1.0.1)
|
||||
manifique (1.1.0)
|
||||
faraday (~> 2.9.0)
|
||||
faraday-follow_redirects (= 0.3.0)
|
||||
nokogiri (~> 1.16.0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[](https://rubygems.org/gems/manifique)
|
||||
[](https://drone.kosmos.org/5apps/manifique)
|
||||
|
||||
# Manifique
|
||||
|
||||
@@ -43,7 +43,13 @@ module Manifique
|
||||
end
|
||||
|
||||
if options[:type]
|
||||
results.reject! { |r| r["type"] != options[:type] }
|
||||
if options[:type].is_a?(String)
|
||||
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
|
||||
|
||||
if options[:sizes]
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Manifique
|
||||
VERSION = "1.0.1"
|
||||
VERSION = "1.1.0"
|
||||
end
|
||||
|
||||
@@ -68,6 +68,16 @@ RSpec.describe Manifique::Metadata do
|
||||
icon = metadata.select_icon(type: "image/png")
|
||||
expect(icon["sizes"]).to eq("512x512")
|
||||
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
|
||||
|
||||
describe "by size" do
|
||||
|
||||
Reference in New Issue
Block a user