yt 0.11.5 → 0.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/yt/collections/snippets.rb +1 -7
- data/lib/yt/collections/statuses.rb +1 -1
- data/lib/yt/version.rb +1 -1
- data/spec/requests/as_server_app/resource_spec.rb +35 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55e1f1f22fd6b8b4e6fe44a48fc7810ea9d0339
|
4
|
+
data.tar.gz: 240e018e958c9e5ebe768736da774dfafaaf345f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1573d2e0347daa451e4e77912307d27986694d9e2a1839d4c1ac632703f5a2343dc36ea91a83b57f27a5125179048a89fb2df6b8bc91bb2b153e028ae85f77c
|
7
|
+
data.tar.gz: 250cc4b5a7ac15fa4499347c181b954a73a60620385960da00b83ef8058ab4a60d847ebd134ad5770ea5a1f280e55eddedb9549fbaae7fe11ae687409cf98e43
|
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.11.6 - 2014-08-28
|
10
|
+
|
11
|
+
* [BUGFIX] Make Resource.new(url: url).title hit the right endpoint
|
12
|
+
|
9
13
|
## 0.11.5 - 2014-08-27
|
10
14
|
|
11
15
|
* [BUGFIX] Make videos.where(id: 'MESycYJytkU').first.id return 'MESycYJytkU'
|
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.11.
|
44
|
+
gem 'yt', '~> 0.11.6'
|
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*)
|
@@ -11,17 +11,11 @@ module Yt
|
|
11
11
|
{data: data['snippet'], auth: @auth}
|
12
12
|
end
|
13
13
|
|
14
|
-
# # @return [Yt::Models::Snippet] a new snippet initialized with
|
15
|
-
# # one of the items returned by asking YouTube for a list of snippets.
|
16
|
-
# def new_item(data)
|
17
|
-
# Yt::Snippet.new data: data['snippet'], auth: @auth
|
18
|
-
# end
|
19
|
-
|
20
14
|
# @return [Hash] the parameters to submit to YouTube to get the
|
21
15
|
# snippet of a resource, for instance a channel.
|
22
16
|
# @see https://developers.google.com/youtube/v3/docs/channels#resource
|
23
17
|
def list_params
|
24
|
-
endpoint = @parent.
|
18
|
+
endpoint = @parent.kind.pluralize.camelize :lower
|
25
19
|
super.tap do |params|
|
26
20
|
params[:path] = "/youtube/v3/#{endpoint}"
|
27
21
|
params[:params] = {id: @parent.id, part: 'snippet'}
|
@@ -15,7 +15,7 @@ module Yt
|
|
15
15
|
# of a resource, for instance a channel.
|
16
16
|
# @see https://developers.google.com/youtube/v3/docs/channels/list
|
17
17
|
def list_params
|
18
|
-
endpoint = @parent.
|
18
|
+
endpoint = @parent.kind.pluralize.camelize :lower
|
19
19
|
super.tap do |params|
|
20
20
|
params[:path] = "/youtube/v3/#{endpoint}"
|
21
21
|
params[:params] = {id: @parent.id, part: 'status'}
|
data/lib/yt/version.rb
CHANGED
@@ -4,15 +4,43 @@ require 'yt/models/resource'
|
|
4
4
|
describe Yt::Resource, :server_app do
|
5
5
|
subject(:resource) { Yt::Resource.new url: url }
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
context 'given the URL of an existing channel' do
|
8
|
+
let(:url) { 'youtube.com/fullscreen' }
|
9
|
+
|
10
|
+
specify 'provides access to its data' do
|
11
|
+
expect(resource.id).to eq 'UCxO1tY8h1AhOz0T4ENwmpow'
|
12
|
+
expect(resource.title).to eq 'Fullscreen'
|
13
|
+
expect(resource.privacy_status).to eq 'public'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'given the URL of an existing video' do
|
18
|
+
let(:url) { 'https://www.youtube.com/watch?v=MESycYJytkU&list=LLxO1tY8h1AhOz0T4ENwmpow' }
|
19
|
+
|
20
|
+
specify 'provides access to its data' do
|
21
|
+
expect(resource.id).to eq 'MESycYJytkU'
|
22
|
+
expect(resource.title).to eq 'Fullscreen Creator Platform'
|
23
|
+
expect(resource.privacy_status).to eq 'public'
|
11
24
|
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'given the URL of an existing playlist' do
|
28
|
+
let(:url) { 'https://www.youtube.com/playlist?list=LLxO1tY8h1AhOz0T4ENwmpow' }
|
29
|
+
|
30
|
+
specify 'provides access to its data' do
|
31
|
+
expect(resource.id).to eq 'LLxO1tY8h1AhOz0T4ENwmpow'
|
32
|
+
expect(resource.title).to eq 'Liked videos'
|
33
|
+
expect(resource.privacy_status).to eq 'public'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'given an unknown URL' do
|
38
|
+
let(:url) { 'youtube.com/--not-a-valid-url--' }
|
12
39
|
|
13
|
-
|
14
|
-
|
15
|
-
|
40
|
+
specify 'accessing its data raises an error' do
|
41
|
+
expect{resource.id}.to raise_error Yt::Errors::NoItems
|
42
|
+
expect{resource.title}.to raise_error Yt::Errors::NoItems
|
43
|
+
expect{resource.status}.to raise_error Yt::Errors::NoItems
|
16
44
|
end
|
17
45
|
end
|
18
46
|
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.11.
|
4
|
+
version: 0.11.6
|
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-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|