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 +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +2 -2
- data/lib/yt/models/status.rb +10 -5
- data/lib/yt/models/video.rb +1 -1
- data/lib/yt/version.rb +1 -1
- data/spec/models/status_spec.rb +2 -2
- data/spec/requests/as_account/channel_spec.rb +2 -4
- data/spec/requests/as_account/video_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bec2c87e88e376b5afac03f9764213e285f047d0
|
4
|
+
data.tar.gz: 8145cf48aeeec52f7fa5b4efc151e978b77fffe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2144d12d72d8e21815a2a031008006a8e7e861ed15110f9608e8f5df27ba2babeac4796c7116e47857761e002d280c19c2447455db36023bf434a20607a146f3
|
7
|
+
data.tar.gz: e8c4c34065211e919f8410ac5d6e683b2dd1d8ab6d5230d9c7363df4210ac9198d796892406a362c2e59beb3c6026317f423ae58c18fd11bc542b020606cef91
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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.
|
332
|
+
video.uploading? #=> false
|
333
333
|
video.rejected? #=> false
|
334
334
|
video.failed? #=> true
|
335
335
|
video.processed? #=> false
|
data/lib/yt/models/status.rb
CHANGED
@@ -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,
|
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
|
88
|
-
# @return [Boolean] if the resource is a video, whether the video
|
89
|
-
#
|
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
|
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.
|
data/lib/yt/models/video.rb
CHANGED
@@ -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
|
data/lib/yt/version.rb
CHANGED
data/spec/models/status_spec.rb
CHANGED
@@ -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
|
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
|
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
|
-
#
|
166
|
-
|
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.
|
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]
|