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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42014f27313df641d183c3372c321750d4286503
4
- data.tar.gz: fdfcb6df1b63ed5943f50292111c43279c3e8cbd
3
+ metadata.gz: c55e1f1f22fd6b8b4e6fe44a48fc7810ea9d0339
4
+ data.tar.gz: 240e018e958c9e5ebe768736da774dfafaaf345f
5
5
  SHA512:
6
- metadata.gz: bb5e31dcea230569c121333be4829eb24c964224c88e60ba506fbbe7aadc2aae4019be292a944135da2b07e0fa89d2e36306adcc5f853685d4d0c83612901163
7
- data.tar.gz: 34df50c4d27f24824605e49e8a9305b8efdbe290b94aab35f31ff5f254f979ed5edac78ec266fdae61ebec4a0333226882e6185ec68443f1206c60db0eb41db2
6
+ metadata.gz: d1573d2e0347daa451e4e77912307d27986694d9e2a1839d4c1ac632703f5a2343dc36ea91a83b57f27a5125179048a89fb2df6b8bc91bb2b153e028ae85f77c
7
+ data.tar.gz: 250cc4b5a7ac15fa4499347c181b954a73a60620385960da00b83ef8058ab4a60d847ebd134ad5770ea5a1f280e55eddedb9549fbaae7fe11ae687409cf98e43
@@ -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.5'
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.class.to_s.pluralize.demodulize.camelize :lower
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.class.to_s.pluralize.demodulize.camelize :lower
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'}
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.11.5'
2
+ VERSION = '0.11.6'
3
3
  end
@@ -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
- describe '#id' do
8
- context 'given a URL containing an existing username' do
9
- let(:url) { 'youtube.com/fullscreen' }
10
- it { expect(resource.id).to eq 'UCxO1tY8h1AhOz0T4ENwmpow' }
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
- context 'given a URL containing an unknown username' do
14
- let(:url) { 'youtube.com/--not--a--valid--username' }
15
- it { expect{resource.id}.to raise_error Yt::Errors::NoItems }
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.5
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-27 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport