onebox 1.5.23 → 1.5.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b94e9f549867048719ac4be58c7bfe8ac1f7add1
4
- data.tar.gz: 101edaaae7ea70b7f62d36f5cf59220fcd35ab3b
3
+ metadata.gz: 325c78dc8e7b023d1c9fa602668ac063886f0a96
4
+ data.tar.gz: a3313ae6ceabd4b2afb05082d24bb2a85c288ad4
5
5
  SHA512:
6
- metadata.gz: 682207fa30191d21690b08ce72bb9dd74a1b969d01d698d42dc3b81a4bc88ac4194ba83a4831ff59acb7a48bd39554bf06dad88edeb1d33bdfcf817910e8df08
7
- data.tar.gz: 2943b3d46a0abba088984ba14de5deaecf9daf7db7cf47d2165e37f72de05b2ab9203e6b58af7de05252b06f24faa2940f7f7e744b04fe1abd40e5c36460de46
6
+ metadata.gz: 435767c92b01387432db95e26cf0ccc954c18b4644f25fc5ad235b0ca211252816d780fb14c9ad2ca375cae63457dbcbdc65187b62873f845de52b6655e80bc2
7
+ data.tar.gz: 24cce4308f5a83b0d6a4aba6efd81626abd260bb6ce446b74704a159882df7e13159cc16992a32b1656b3ae8051cc7fefbd7a2fa26baf3f14c0d3826b933c518
@@ -28,7 +28,7 @@ module Onebox
28
28
  matches_regexp :custom, %r"^(?:https?:)?//www\.google(?:\.(?:\w{2,}))+/maps/d/(?:edit|viewer|embed)\?mid=.+$"
29
29
 
30
30
  # Matches URLs with streetview data
31
- matches_regexp :streetview, %r"^(?:https?:)?//www\.google(?:\.(?:\w{2,}))+/maps[^@]+@(?<lon>[\d.]+),(?<lat>[\d.]+),(?:\d+)a,(?<zoom>[\d.]+)y,(?<heading>[\d.]+)h,(?<pitch>[\d.]+)t.+?data=.*?!1s(?<pano>[^!]{22})"
31
+ matches_regexp :streetview, %r"^(?:https?:)?//www\.google(?:\.(?:\w{2,}))+/maps[^@]+@(?<lon>-?[\d.]+),(?<lat>-?[\d.]+),(?:\d+)a,(?<zoom>[\d.]+)y,(?<heading>[\d.]+)h,(?<pitch>[\d.]+)t.+?data=.*?!1s(?<pano>[^!]{22})"
32
32
 
33
33
  # Matches "normal" Google Maps URLs with arbitrary data
34
34
  matches_regexp :standard, %r"^(?:https?:)?//www\.google(?:\.(?:\w{2,}))+/maps"
@@ -24,7 +24,7 @@ module Onebox
24
24
  description: raw.css(".text-body div").inner_text[0..DEFAULTS[:MAX_DESCRIPTION_CHARS]].chop + "...",
25
25
  price: raw.css(".price.buy meta[itemprop=price]").first["content"]
26
26
  }
27
- if result[:price].to_i <= 0 then
27
+ if result[:price] == "0" then
28
28
  result[:price] = "Free"
29
29
  end
30
30
  result
@@ -4,12 +4,12 @@ module Onebox
4
4
  include Engine
5
5
  include StandardEmbed
6
6
 
7
- matches_regexp(/^https?:\/\/.*imgur\.com/)
7
+ matches_regexp(/^https?:\/\/(www\.)?imgur\.com/)
8
8
  always_https
9
9
 
10
10
  def to_html
11
11
  imgur_data = get_imgur_data
12
- return "<video width='#{imgur_data[:"player:width"]}' height='#{imgur_data[:"player:height"]}' controls autoplay loop><source src='#{imgur_data[:"player:stream"]}' type='video/mp4'></video>" if imgur_data[:"player:stream"]
12
+ return "<video width='#{imgur_data[:"player:width"]}' height='#{imgur_data[:"player:height"]}' controls autoplay loop><source src='#{imgur_data[:"player:stream"]}' type='video/mp4'><source src='#{imgur_data[:"player:stream"].gsub('mp4', 'webm')}' type='video/webm'></video>" if imgur_data[:"player:stream"]
13
13
  return "<a href='#{url}' target='_blank'><img src='#{imgur_data[:image]}' alt='Imgur' height='#{imgur_data[:"image:height"]}' width='#{imgur_data[:"image:width"]}'></a>" if imgur_data[:image]
14
14
  return "<a href='#{url}' target='_blank'><img src='#{imgur_data[:"image0:src"]}' alt='Imgur'></a>" if imgur_data[:"image0:src"]
15
15
  return nil
@@ -1,3 +1,3 @@
1
1
  module Onebox
2
- VERSION = "1.5.23"
2
+ VERSION = "1.5.24"
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.23
4
+ version: 1.5.24
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: 2015-08-05 00:00:00.000000000 Z
13
+ date: 2015-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -414,7 +414,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
414
414
  version: '0'
415
415
  requirements: []
416
416
  rubyforge_project:
417
- rubygems_version: 2.4.3
417
+ rubygems_version: 2.4.5
418
418
  signing_key:
419
419
  specification_version: 4
420
420
  summary: A gem for turning URLs into previews.