funky 0.2.6 → 0.2.7

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: c12c6cf624054022ab7be08e14107d94db62f93f
4
- data.tar.gz: 0026bc8e6a74c72a46238e7888d1367a0a0ee08b
3
+ metadata.gz: 32576d871d1cb5d959abde5a785e5c88128c5384
4
+ data.tar.gz: d49deafb4f57e10601941c90ee09027da58fda53
5
5
  SHA512:
6
- metadata.gz: b3eca109c94d95e8f03372b5116c9fad6467478f56801aef45f3d77044d94b7d5ae4d5088e24f00d4ac4d8a2d99d772bee84a0f0092358364697160fc985d4fc
7
- data.tar.gz: 6375edbbe2f47395e65447b1c3de3e486945ca57f2ec4d0b2c5c6246ecd6711b81e5d5826223c40582c105f9301c2dd05a321e962f0687f559220e0f70c84c00
6
+ metadata.gz: 53de099fde4630d452c4627c02fb0b0c1981406a87a58f6973ae8ac4e4980ca2667f52b00438a6e4d0efdd09bcabbce695978ce0281c582756624a99295e5fe6
7
+ data.tar.gz: 31b2ddd5bef4732bf6269eb3287849c525cf0e5f8f65f132844c7b787b91f4d009aadd448141a58b4e1b892bea710d5f913a6a236a7d67c7c488929c2e3ad3d2
data/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.2.7 - 2016/08/18
10
+
11
+ * [ENHANCEMENT] When Funky makes a request to an HTML page, Funky would now raise `Funky::ConnectionError` should the following errors occur:
12
+ OpenSSL::SSL::SSLError,
13
+ Errno::ETIMEDOUT,
14
+ Errno::EHOSTUNREACH,
15
+ Errno::ENETUNREACH,
16
+ Errno::ECONNRESET,
17
+ Net::OpenTimeout,
18
+ SocketError
19
+
9
20
  ## 0.2.6 - 2016/08/05
10
21
 
11
22
  * [BUGFIX] Force scraping to use English-US version of Facebook by appending `locale=en_US` to the query string. This prevents cases where Funky's requests originate from non English speaking countries and receiving different HTML templates.
@@ -19,7 +19,7 @@ module Funky
19
19
  Net::HTTP.start(uri.host, 443, use_ssl: true) do |http|
20
20
  http.request request
21
21
  end
22
- rescue SocketError => e
22
+ rescue *server_errors => e
23
23
  raise ConnectionError, e.message
24
24
  end
25
25
 
@@ -28,6 +28,18 @@ module Funky
28
28
  path: '/video.php',
29
29
  query: "v=#{video_id}&locale=en_US"
30
30
  end
31
+
32
+ def server_errors
33
+ [
34
+ OpenSSL::SSL::SSLError,
35
+ Errno::ETIMEDOUT,
36
+ Errno::EHOSTUNREACH,
37
+ Errno::ENETUNREACH,
38
+ Errno::ECONNRESET,
39
+ Net::OpenTimeout,
40
+ SocketError
41
+ ]
42
+ end
31
43
  end
32
44
  end
33
45
  end
data/lib/funky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Funky
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler