onebox 1.5.41 → 1.5.42

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
  SHA1:
3
- metadata.gz: 4aec127130a7fa4b977b1bbd2f144c469cc27144
4
- data.tar.gz: a733fa7ef463e2df0a2d1de7c289aba400d0905a
3
+ metadata.gz: 5df76e6cfd4d93a0e81cb5288ac46785a9b2b61f
4
+ data.tar.gz: 021f30c7089785dd8c9929d43b37d3c09017e2bd
5
5
  SHA512:
6
- metadata.gz: 820d9dc259dcb3a666a754f845f1a214eb7fd263c957c0a93aca7f144894181d31ce39d5e1e45a2996d2db69c12df72efecbdcf89dfd05ffd53bf8075ec3f996
7
- data.tar.gz: 1ccd2714f032faf91a7f2d75a6abe6da5408cc4fb720c98933f623fe3f2476dd7f8de1302d3b86cd1e3dc8fc56895541f84a098305e34b3ce1b35fdd6640d459
6
+ metadata.gz: f5066e2861f060c1d961d1d20a3c43535c62eb376981fc7ab8b1817099d17400813d12788943f43d0db0605e1d58d6190bcfbffc94fbf12b74e7e175983ec1c0
7
+ data.tar.gz: 26ea7441e7bd215be1e8f20d7e7afb24db0595991323914480b24ff9a6f6359d8528c884e68c8eae2aefed480b6321c61d406693051840b9dae32d524bcb896f
@@ -36,6 +36,7 @@ module Onebox
36
36
  cnet.com
37
37
  cnn.com
38
38
  collegehumor.com
39
+ consider.it
39
40
  coursera.org
40
41
  codepen.io
41
42
  cracked.com
@@ -82,6 +83,7 @@ module Onebox
82
83
  meetup.com
83
84
  mixcloud.com
84
85
  mlb.com
86
+ myshopify.com
85
87
  myspace.com
86
88
  nba.com
87
89
  nytimes.com
@@ -209,7 +211,7 @@ module Onebox
209
211
  end
210
212
 
211
213
  def generic_html
212
- return data[:html] if html_type?
214
+ return add_thumbnail_class(data[:html]) if html_type?
213
215
  return layout.to_html if article_type?
214
216
  return html_for_video(data[:video]) if data[:video]
215
217
  return image_html if photo_type?
@@ -332,6 +334,17 @@ module Onebox
332
334
  html << " #{attribute.to_s}=\"#{val}\""
333
335
  end
334
336
  end
337
+
338
+ def add_thumbnail_class(data)
339
+ fragment = Nokogiri::HTML::fragment(data)
340
+ if fragment
341
+ fragment.search('img').each do |img|
342
+ img['class'] = "thumbnail"
343
+ end
344
+ end
345
+
346
+ return fragment.to_html
347
+ end
335
348
  end
336
349
  end
337
350
  end
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.41"
2
+ VERSION = "1.5.42"
3
3
  end
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: 1.5.41
4
+ version: 1.5.42
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: 2016-05-25 00:00:00.000000000 Z
13
+ date: 2016-06-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -495,3 +495,4 @@ test_files:
495
495
  - spec/lib/onebox_spec.rb
496
496
  - spec/spec_helper.rb
497
497
  - spec/support/html_spec_helper.rb
498
+ has_rdoc: