yt 0.14.4 → 0.14.5

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: ac3b279f2bcc4efa9194c125ce7ca64741dcc61f
4
- data.tar.gz: 0e212a30198ac5bc8e34efadb0cd90ff4bf324ea
3
+ metadata.gz: 3c0fb3dd9be2c795af5118f9ce95351813ab224b
4
+ data.tar.gz: 2d0c74c00e5e0445f85def8f971d16786eec5b0f
5
5
  SHA512:
6
- metadata.gz: c322a11b50cad429ff7dfa5d594067dedd80971dd53614d62eefff4b7935740179eba9f9587c64fe9fb60b548bd37eb86cf39860198c29cbc5e670fa75243ef8
7
- data.tar.gz: 4a96924e562e534ce0fc44db33bc1d97df6ec29cc310e3286db7cde6e52edfcf3f33444d23229a80c7929b7f56318d19d351bf9b5c38cf088704e547f5cd8499
6
+ metadata.gz: 9a0ed9ab75851b4f3bdb47170b5016c9717cca959974c9c8236f226054ad57bbc8fc17f9bbdda0ca86e7ba3dcf137f9959f5f630408858ab0f85b197c4fc1155
7
+ data.tar.gz: 1e482b5dce6aded77512115ca9aaf1979d524c475439e9944db3376daabdbdfba628eadeac53d6bf122e29ffd7e71bc9c610add79d9dc7d8eebf920325849a15
data/CHANGELOG.md CHANGED
@@ -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.14.5 - 2015-04-15
10
+
11
+ * [BUGFIX] Raise `Yt::Errors::RequestError` when passing an invalid path or URL to `upload_thumbnail`
12
+
9
13
  ## 0.14.4 - 2015-04-14
10
14
 
11
15
  * [FEATURE] New `by: :embedded_player_location` option for reports, to return views and estimated watched minutes (channels) by URL where the player was embedded
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.14.4'
44
+ gem 'yt', '~> 0.14.5'
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*)
@@ -197,9 +197,11 @@ module Yt
197
197
  # @param [String] path_or_url the image to upload. Can either be the
198
198
  # path of a local file or the URL of a remote file.
199
199
  # @return the new thumbnail resource for the given image.
200
+ # @raise [Yt::Errors::RequestError] if path_or_url is not a valid path
201
+ # or URL.
200
202
  # @see https://developers.google.com/youtube/v3/docs/thumbnails#resource
201
203
  def upload_thumbnail(path_or_url)
202
- file = open path_or_url, 'rb'
204
+ file = open(path_or_url, 'rb') rescue StringIO.new
203
205
  session = resumable_sessions.insert file.size
204
206
 
205
207
  session.update(body: file) do |data|
data/lib/yt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.14.4'
2
+ VERSION = '0.14.5'
3
3
  end
@@ -377,5 +377,11 @@ describe Yt::Video, :device_app do
377
377
 
378
378
  it { expect{update}.not_to raise_error }
379
379
  end
380
+
381
+ context 'given an invalid URL' do
382
+ let(:path_or_url) { 'this-is-not-a-url' }
383
+
384
+ it { expect{update}.to raise_error Yt::Errors::RequestError }
385
+ end
380
386
  end
381
387
  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.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport