onebox 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90c9d1f633caf0798657ff3655a0d41cca71364ed0199bc3beea5f686df4c148
|
4
|
+
data.tar.gz: 8360d4b10bf5af91a8905e09777bd305545a8db0448b9b80301b39b7bd37b1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232104ac79cb41e53b404e90e930d1ed229f07df11dab37d72d5267366082f8d26a9d7185dd1b51a3dfe2d1eac9d71f30fddde58203fadffb8c209bcfdfa5cd2
|
7
|
+
data.tar.gz: f25d39bc21a67607a78924abee0d31ce18137d06fc672fe820cd9d0758a155e3e5370795c924bc1f404b2be41cfd93669c7709d9616043828ee1cca588afe2b4
|
@@ -286,7 +286,7 @@ module Onebox
|
|
286
286
|
return image_html if is_image?
|
287
287
|
return embedded_html if is_embedded?
|
288
288
|
return card_html if is_card?
|
289
|
-
return article_html if has_text?
|
289
|
+
return article_html if (has_text? || is_image_article?)
|
290
290
|
end
|
291
291
|
|
292
292
|
def is_card?
|
@@ -301,8 +301,15 @@ module Onebox
|
|
301
301
|
end
|
302
302
|
|
303
303
|
def has_text?
|
304
|
-
!Onebox::Helpers.blank?(data[:
|
305
|
-
|
304
|
+
has_title? && !Onebox::Helpers.blank?(data[:description])
|
305
|
+
end
|
306
|
+
|
307
|
+
def has_title?
|
308
|
+
!Onebox::Helpers.blank?(data[:title])
|
309
|
+
end
|
310
|
+
|
311
|
+
def is_image_article?
|
312
|
+
has_title? && has_image?
|
306
313
|
end
|
307
314
|
|
308
315
|
def is_image?
|
@@ -7,11 +7,11 @@ module Onebox
|
|
7
7
|
include StandardEmbed
|
8
8
|
include LayoutSupport
|
9
9
|
|
10
|
-
matches_regexp(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/?(?:.*)\/p\/[a-zA-Z\d_-]+/)
|
10
|
+
matches_regexp(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/?(?:.*)\/(?:p|tv)\/[a-zA-Z\d_-]+/)
|
11
11
|
always_https
|
12
12
|
|
13
13
|
def clean_url
|
14
|
-
url.scan(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/?(?:.*)\/p\/[a-zA-Z\d_-]+/).flatten.first
|
14
|
+
url.scan(/^https?:\/\/(?:www\.)?(?:instagram\.com|instagr\.am)\/?(?:.*)\/(?:p|tv)\/[a-zA-Z\d_-]+/).flatten.first
|
15
15
|
end
|
16
16
|
|
17
17
|
def data
|
data/lib/onebox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joanna Zeta
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-12-
|
13
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|