yt 0.7.11 → 0.8.0

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: f68323942ee8bbe17cfaee4597c9e608f33c118d
4
- data.tar.gz: 745a59c51f7ab201a9fa01f14ddf1613ccf0c8fd
3
+ metadata.gz: 61f559b96e49f82854993bc9fa8be3e6afab9aaa
4
+ data.tar.gz: cd332a6c0162c3c28abadd06c7c50cce24823924
5
5
  SHA512:
6
- metadata.gz: 470da624d81c6433c66346e55a4d375fec56bf6f10d7d1e730e20956f6afcde80719c95656a0809c4b27e39325e701886076c7c0f5617bd6311dc1e5b06e338d
7
- data.tar.gz: fa26426355b8cb643494e483cb1e729d09c1413e5ba78c2d67bee1121a036e5c53ac4031dc86c257e3228c060fe7869ed67580dcd94fdbff48719d357d941076
6
+ metadata.gz: e310ae789d8cb9c390c2b39681faa251ec90b3b0c0189aec22d3e81719c1b13a65ca6ede2e996a108956eb0d5c342c1a99198405bd61a4eed371623f819b990e
7
+ data.tar.gz: ac16bdf814bcab2fb1f6bb704ed00c890b13fe07824cb8d1dcaa27f2d940dd08c5492ba1623110c188ef0923eca874512f74e40426faf6274dfb7c8698f3510d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.7.11)
4
+ yt (0.8.0)
5
5
  activesupport
6
6
 
7
7
  GEM
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ v0.8 - 2014/07/18
2
+ -----------------
3
+
4
+ * [breaking change] channel.subscribe returns nil (not raise an error) when trying to subscribe to your own channel
5
+
1
6
  v0.7 - 2014/06/18
2
7
  -----------------
3
8
 
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.7.11'
44
+ gem 'yt', '~> 0.8.0'
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*)
data/lib/yt.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  require 'yt/config'
2
2
  require 'yt/models/account'
3
+ require 'yt/models/channel'
3
4
  require 'yt/models/content_owner'
5
+ require 'yt/models/playlist'
6
+ require 'yt/models/playlist_item'
7
+ require 'yt/models/video'
4
8
 
5
9
  # An object-oriented Ruby client for YouTube.
6
10
  # Helps creating applications that need to interact with YouTube objects.
@@ -9,8 +9,9 @@ module Yt
9
9
  throttle
10
10
  do_insert
11
11
  rescue Yt::Error => error
12
- ignorable_errors = error.reasons & ['subscriptionDuplicate']
13
- raise error unless options[:ignore_errors] && ignorable_errors.any?
12
+ ignorable_error = error.reasons.include? 'subscriptionDuplicate'
13
+ ignorable_error ||= (@parent.id == @auth.channel.id) if @auth
14
+ raise error unless options[:ignore_errors] && ignorable_error
14
15
  end
15
16
 
16
17
  def delete_all(params = {}, options = {})
data/lib/yt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.7.11'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -74,11 +74,11 @@ describe Yt::Channel, :device_app do
74
74
  it { expect{channel.delete_playlists params}.to change{channel.playlists.count}.by(-1) }
75
75
  end
76
76
 
77
- # NOTE: This test is just a reflection of YouTube irrational behavior of
78
- # raising a 500 error when you try to subscribe to your own channel,
79
- # rather than a more logical 4xx error. Hopefully this will get fixed
80
- # and this code (and test) removed.
81
- it { expect{channel.subscribe}.to raise_error Yt::Errors::ServerError }
77
+ # @note: this test is just a reflection of YouTube irrational behavior of
78
+ # raising a 500 error when you try to subscribe to your own channel.
79
+ # `subscribe` will ignore the error, but `subscribe!` will raise it.
80
+ it { expect{channel.subscribe!}.to raise_error Yt::Errors::ServerError }
81
+ it { expect(channel.subscribe).to be_falsey }
82
82
 
83
83
  it 'returns valid reports for channel-related metrics' do
84
84
  # Some reports are only available to Content Owners.
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.7.11
4
+ version: 0.8.0
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-07-18 00:00:00.000000000 Z
11
+ date: 2014-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport