yt 0.13.2 → 0.13.3

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: f679a170ffd18946f7b4922609c489a05913c081
4
- data.tar.gz: f10004d3f1d9897080f717e074157dbbb82d662f
3
+ metadata.gz: c4b21a647e6bab1583b5afb67fef9459ecf59466
4
+ data.tar.gz: fb879355564a7238927f8ad32aa3201bbe4631b8
5
5
  SHA512:
6
- metadata.gz: 119a8546b3bb9d5f9911058d18b546d2e04600d926914865048cb0481782e4b3866973d5e80bb75b8e9ef8f73f184aba09a75b88ad4fa5ede334138d6d86dabd
7
- data.tar.gz: 7b37140a9f7ac1c07945c294ff214dccd1d3fb8c576b7636afa182edcd81f41b4cc0adc63a3bfdb00aa4ae3a210b90f3ed547a14ce32ca28ee1068aded418e16
6
+ metadata.gz: c453c1f45ae6eadb041cad24806891575fd4fdf9b3972a237442f4522b4b134a9c36521fa70724ee65ef332d81f44357b94f4e54eba43c9a6ff80c2908a617cc
7
+ data.tar.gz: de773e6562299849e7d901f5926578000175faf1fa1e66ec9bd4561e5531441e5eacd09527e644bce9cbd9d647dfa894a34557cd1ac3c05652d29bf8ab3c3360
@@ -6,6 +6,10 @@ 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.13.3 - 2014-10-01
10
+
11
+ * [BUGFIX] Rescue OpenSSL::SSL::SSLErrorWaitReadable raised by YouTube servers.
12
+
9
13
  ## 0.13.2 - 2014-10-01
10
14
 
11
15
  * [FEATURE] Add `release!` to Ownership.
data/README.md CHANGED
@@ -41,7 +41,7 @@ To install on your system, run
41
41
 
42
42
  To use inside a bundled Ruby project, add this line to the Gemfile:
43
43
 
44
- gem 'yt', '~> 0.13.2'
44
+ gem 'yt', '~> 0.13.3'
45
45
 
46
46
  Since the gem follows [Semantic Versioning](http://semver.org),
47
47
  indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
@@ -202,6 +202,7 @@ module Yt
202
202
  def server_errors
203
203
  [
204
204
  OpenSSL::SSL::SSLError,
205
+ OpenSSL::SSL::SSLErrorWaitReadable,
205
206
  Errno::ETIMEDOUT,
206
207
  Errno::ENETUNREACH,
207
208
  Errno::ECONNRESET,
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.13.2'
2
+ VERSION = '0.13.3'
3
3
  end
@@ -116,6 +116,27 @@ describe Yt::Request do
116
116
  it { expect{request.run}.not_to fail }
117
117
  end
118
118
  end
119
+
120
+ # NOTE: This test is just a reflection of YouTube irrational behavior of
121
+ # being unavailable once in a while, and therefore causing Net::HTTP to
122
+ # fail, although retrying after some seconds works.
123
+ context 'an OpenSSL::SSL::SSLErrorWaitReadable' do
124
+ let(:http_error) { OpenSSL::SSL::SSLErrorWaitReadable.new }
125
+
126
+ context 'every time' do
127
+ before { expect(Net::HTTP).to receive(:start).at_least(:once).and_raise http_error }
128
+
129
+ it { expect{request.run}.to fail }
130
+ end
131
+
132
+ context 'but works the second time' do
133
+ before { expect(Net::HTTP).to receive(:start).at_least(:once).and_return retry_response }
134
+ before { allow(retry_response).to receive(:body) }
135
+ let(:retry_response) { Net::HTTPOK.new nil, nil, nil }
136
+
137
+ it { expect{request.run}.not_to fail }
138
+ end
139
+ end
119
140
  end
120
141
  end
121
142
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport