yt 0.4.8 → 0.4.9

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: d001dddb418e4e74f6de7356d350befaaec179d1
4
- data.tar.gz: 2356e2a5fa9861028411c6f8b0ca99b94d79f735
3
+ metadata.gz: f25c54b1f1004f4f077834c4363e122ddc0fe605
4
+ data.tar.gz: dac600c6f7846186cd83993a857de02c750946ad
5
5
  SHA512:
6
- metadata.gz: 4de11d3034cba5ec8702c2c747c8689142f915bb4e8d17d6dc21e65e583359ff5b6bba94f9f2f855229227cc7a6c8ec76a325a2af8ac49edf24e145954850352
7
- data.tar.gz: bfcd0d23ea29ed718595bf6e71a9bc6552cc1fa748aa1d1f76dafd73e76c37708b126b83f5539cd716c9740e013f4e67c7f6109c34c0f1f56f151c16402160f2
6
+ metadata.gz: f2d6a9d99f716a34d3ec647ccb1ef117fa7cfdabbea3aa4fe28c379c72a1f607bbf12f230ebd07ea85abec14a54554ad0ef13b80b49572a66b262f53a6748de6
7
+ data.tar.gz: c9cdf87a2f003dca6d3b99e66d57bff636ce64aec589a27263ddd7d8838118462083b0e45af8291bf2601c9b504d82877c9e367e333034b032cc20097f70ac50
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.4.8)
4
+ yt (0.4.9)
5
5
  activesupport
6
6
 
7
7
  GEM
data/HISTORY.md CHANGED
@@ -6,7 +6,7 @@ v0.4 - 2014/05/09
6
6
  * Supports also ActiveSupport 3 and Ruby 1.9.3 (not just AS4 + Ruby 2)
7
7
  * Fix parsing annotation and timestamps longer than 1 hour
8
8
  * Fix delegating tags from resources to snippets
9
- * Two options to add videos to a playlist: fail or not if a video is missing
9
+ * Two options to add videos to a playlist: fail or not if a video is missing or its account terminated
10
10
  * Allow to configure Yt credentials through environment variables
11
11
 
12
12
  v0.3.0 - 2014/04/16
data/README.md CHANGED
@@ -302,7 +302,7 @@ To install on your system, run
302
302
 
303
303
  To use inside a bundled Ruby project, add this line to the Gemfile:
304
304
 
305
- gem 'yt', '~> 0.4.8'
305
+ gem 'yt', '~> 0.4.9'
306
306
 
307
307
  Since the gem follows [Semantic Versioning](http://semver.org),
308
308
  indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
@@ -11,7 +11,7 @@ module Yt
11
11
  end
12
12
 
13
13
  def add_video(video_id)
14
- playlist_items.insert({id: video_id, kind: :video}, ignore_not_found: true)
14
+ playlist_items.insert({id: video_id, kind: :video}, ignore_errors: true)
15
15
  end
16
16
 
17
17
  def add_video!(video_id)
@@ -12,7 +12,7 @@ module Yt
12
12
  snippet = {playlistId: @parent.id, resourceId: resource}
13
13
  do_insert body: {snippet: snippet}, params: {part: 'snippet,status'}
14
14
  rescue Yt::RequestError => error
15
- raise error unless options[:ignore_not_found] && error.reasons.include?('videoNotFound')
15
+ raise error unless options[:ignore_errors] && (error.reasons.include?('videoNotFound') || error.reasons.include?('forbidden'))
16
16
  end
17
17
 
18
18
  def delete_all(params = {})
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.4.8'
2
+ VERSION = '0.4.9'
3
3
  end
@@ -30,6 +30,12 @@ describe Yt::Associations::PlaylistItems, scenario: :device_app do
30
30
  it { expect(@playlist.add_video video_id).to be_nil }
31
31
  it { expect{@playlist.add_video video_id}.not_to change{@playlist.playlist_items.count} }
32
32
  end
33
+
34
+ context 'given a video of a terminated account' do
35
+ let(:video_id) { 'kDCpdKeTe5g' }
36
+ it { expect(@playlist.add_video video_id).to be_nil }
37
+ it { expect{@playlist.add_video video_id}.not_to change{@playlist.playlist_items.count} }
38
+ end
33
39
  end
34
40
 
35
41
  describe '#add_video!' do
@@ -42,6 +48,11 @@ describe Yt::Associations::PlaylistItems, scenario: :device_app do
42
48
  let(:video_id) { 'not-a-video' }
43
49
  it { expect{@playlist.add_video! video_id}.to raise_error Yt::RequestError }
44
50
  end
51
+
52
+ context 'given a video of a terminated account' do
53
+ let(:video_id) { 'kDCpdKeTe5g' }
54
+ it { expect{@playlist.add_video! video_id}.to raise_error Yt::RequestError }
55
+ end
45
56
  end
46
57
 
47
58
  describe '#add_videos' do
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.4.8
4
+ version: 0.4.9
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-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport