yt 0.15.3 → 0.16.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: 955b88eeaa4654c03880228bf322546eb0fba3c3
4
- data.tar.gz: 8b5bbaf09793909b2230180a49107a58f0f69ed7
3
+ metadata.gz: bec2c87e88e376b5afac03f9764213e285f047d0
4
+ data.tar.gz: 8145cf48aeeec52f7fa5b4efc151e978b77fffe1
5
5
  SHA512:
6
- metadata.gz: 6715a5ff1ec202aa3f1d678aea12baa21f87daf15f1234c3b24e4e0be298b62db322ea1c6ea8e948fd4345a49ca15d27aa3b03237f0f8249d0fea67f371cbcc8
7
- data.tar.gz: eac8f4472b3c814986f3c41469357043019648e523edfef4aafdf4ef3003a4d4700e5c3b2d6eb17df799ed750ebd0372057ecfa2946b3196e0dc43e1df944b60
6
+ metadata.gz: 2144d12d72d8e21815a2a031008006a8e7e861ed15110f9608e8f5df27ba2babeac4796c7116e47857761e002d280c19c2447455db36023bf434a20607a146f3
7
+ data.tar.gz: e8c4c34065211e919f8410ac5d6e683b2dd1d8ab6d5230d9c7363df4210ac9198d796892406a362c2e59beb3c6026317f423ae58c18fd11bc542b020606cef91
@@ -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.16.0 - 2015-04-27
10
+
11
+ **How to upgrade**
12
+
13
+ If your code never calls `video.uploaded?`, then you are good to go.
14
+
15
+ If it does, then replace your calls with `video.uploading?`.
16
+ In fact, the YouTube constant `uploaded` identifies the status where a
17
+ video is **being uploaded**.
18
+
19
+ * [ENHANCEMENT] Rename `uploaded?` to `uploading?` to avoid confusion.
9
20
 
10
21
  ## 0.15.3 - 2015-04-27
11
22
 
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.15.3'
44
+ gem 'yt', '~> 0.16.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*)
@@ -329,7 +329,7 @@ video.category_id #=> "22"
329
329
  video.live_broadcast_content #=> "none"
330
330
 
331
331
  video.public? #=> true
332
- video.uploaded? #=> false
332
+ video.uploading? #=> false
333
333
  video.rejected? #=> false
334
334
  video.failed? #=> true
335
335
  video.processed? #=> false
@@ -46,7 +46,7 @@ module Yt
46
46
  # Returns the upload status of a video.
47
47
  # @return [String] if the resource is a video, the status of the
48
48
  # uploaded video. Valid values are: deleted, failed, processed,
49
- # rejected, uploaded.
49
+ # rejected, uploading.
50
50
  # @return [nil] if the resource is not a video.
51
51
  has_attribute :upload_status
52
52
 
@@ -84,14 +84,19 @@ module Yt
84
84
  upload_status == 'rejected' if video?
85
85
  end
86
86
 
87
- # Returns whether a video was successfully uploaded to YouTube.
88
- # @return [Boolean] if the resource is a video, whether the video was
89
- # successfully uploaded.
87
+ # Returns whether a video is being uploaded to YouTube.
88
+ # @return [Boolean] if the resource is a video, whether the video is
89
+ # being uploaded.
90
90
  # @return [nil] if the resource is not a video.
91
- def uploaded?
91
+ def uploading?
92
92
  upload_status == 'uploaded' if video?
93
93
  end
94
94
 
95
+ # @deprecated Use {uploading?} instead.
96
+ def uploaded?
97
+ uploading?
98
+ end
99
+
95
100
  # Failure reason (Video only)
96
101
 
97
102
  # Returns the reason why a video failed to upload.
@@ -14,7 +14,7 @@ module Yt
14
14
  :scheduled_at, :publish_at, :scheduled?, :too_long?, :violates_terms_of_use?,
15
15
  :inappropriate?, :infringes_trademark?, :belongs_to_closed_account?,
16
16
  :belongs_to_suspended_account?, :licensed_as_creative_commons?,
17
- :licensed_as_standard_youtube?, :has_public_stats_viewable?,
17
+ :licensed_as_standard_youtube?, :has_public_stats_viewable?, :uploading?,
18
18
  :public_stats_viewable, :embeddable, :embeddable?, :license, to: :status
19
19
 
20
20
  # @!attribute [r] content_detail
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.15.3'
2
+ VERSION = '0.16.0'
3
3
  end
@@ -98,12 +98,12 @@ describe Yt::Status do
98
98
  describe '#uploaded?' do
99
99
  context 'given fetching a status returns uploadStatus "uploaded"' do
100
100
  let(:data) { {"uploadStatus"=>"uploaded"} }
101
- it { expect(status).to be_uploaded }
101
+ it { expect(status).to be_uploading }
102
102
  end
103
103
 
104
104
  context 'given fetching a status does not return uploadStatus "uploaded"' do
105
105
  let(:data) { {"uploadStatus"=>"failed"} }
106
- it { expect(status).not_to be_uploaded }
106
+ it { expect(status).not_to be_uploading }
107
107
  end
108
108
  end
109
109
 
@@ -162,10 +162,8 @@ describe Yt::Channel, :device_app do
162
162
  it { expect{channel.delete_playlists params}.to change{channel.playlists.count}.by(-1) }
163
163
  end
164
164
 
165
- # @note: this test is just a reflection of YouTube irrational behavior of
166
- # raising a 500 error when you try to subscribe to your own channel.
167
- # `subscribe` will ignore the error, but `subscribe!` will raise it.
168
- it { expect{channel.subscribe!}.to raise_error Yt::Errors::ServerError }
165
+ # Can't subscribe to your own channel.
166
+ it { expect{channel.subscribe!}.to raise_error Yt::Errors::RequestError }
169
167
  it { expect(channel.subscribe).to be_falsey }
170
168
 
171
169
  it 'returns valid reports for channel-related metrics' do
@@ -36,7 +36,7 @@ describe Yt::Video, :device_app do
36
36
  expect(video.failed?).to be_in [true, false]
37
37
  expect(video.processed?).to be_in [true, false]
38
38
  expect(video.rejected?).to be_in [true, false]
39
- expect(video.uploaded?).to be_in [true, false]
39
+ expect(video.uploading?).to be_in [true, false]
40
40
  expect(video.uses_unsupported_codec?).to be_in [true, false]
41
41
  expect(video.has_failed_conversion?).to be_in [true, false]
42
42
  expect(video.empty?).to be_in [true, false]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.3
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo