onebox 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine.rb +4 -0
- data/lib/onebox/matcher.rb +7 -1
- data/lib/onebox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66fa788b67da32beda2b5c5f9ee946ab9df91dd4
|
4
|
+
data.tar.gz: 44631fb76252c9ca68e1e2b6296efb28d501b1a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c2da907c156abf1012b4910a481391c0a5e658caa71f7b12e01f05f0059df45372a3d7d6c13da415aaa9bc3e60318f68f77c7c0dc1388cc1a7f75c73f717691
|
7
|
+
data.tar.gz: c5b726d096b6c9cda3c39c71ff38c487e4955127e0ad851686f1bcf02ca509bdcc04f32a6b2608cfd441556ce94fa5be89ae3a3a8d22ad61b997719ad6f0e989
|
data/lib/onebox/engine.rb
CHANGED
data/lib/onebox/matcher.rb
CHANGED
@@ -4,10 +4,16 @@ module Onebox
|
|
4
4
|
@url = link
|
5
5
|
end
|
6
6
|
|
7
|
+
def ordered_engines
|
8
|
+
@ordered_engines ||= Engine.engines.sort_by do |e|
|
9
|
+
e.respond_to?(:priority) ? e.priority : 100
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
7
13
|
def oneboxed
|
8
14
|
uri = URI(@url)
|
9
15
|
|
10
|
-
|
16
|
+
ordered_engines.select do |engine|
|
11
17
|
engine === uri
|
12
18
|
end.first
|
13
19
|
rescue URI::InvalidURIError
|
data/lib/onebox/version.rb
CHANGED