yt 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -5
- data/lib/yt/actions/delete_all.rb +4 -1
- data/lib/yt/associations/subscriptions.rb +0 -4
- data/lib/yt/collections/subscriptions.rb +1 -1
- data/lib/yt/version.rb +1 -1
- data/spec/associations/device_auth/playlist_items_spec.rb +1 -1
- data/spec/associations/device_auth/playlists_spec.rb +1 -0
- 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: 4fe44dc454cc59b8d2d6dbb940704f004208c935
|
4
|
+
data.tar.gz: 155dc1491d986ff2e1299088766e7f25731bf314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09ea630bf75f3d65d83aea52f1c6126bf96e81e9a483c60cf5a575d73b2ff2a57ea879d0d4915479aa158198196684b98ba52f3c9676bf7b985dbc24e44ef124
|
7
|
+
data.tar.gz: 2d842bc0e8c7cc5d522d9dacf482a02e11ec0e761710a05d08f3303a3b4cd35e873f1050771abcd37d80f48fe3a3a92b8df95f080a416691575e2bf863ffbfce
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,10 +4,10 @@ Yt
|
|
4
4
|
Yt helps you write apps that need to interact with the YouTube API V3.
|
5
5
|
|
6
6
|
[![Gem Version](https://badge.fury.io/rb/yt.svg)](http://badge.fury.io/rb/yt)
|
7
|
-
[![Dependency Status](https://gemnasium.com/fullscreeninc/
|
8
|
-
[![Build Status](https://travis-ci.org/fullscreeninc/
|
9
|
-
[![Coverage Status](https://coveralls.io/repos/fullscreeninc/
|
10
|
-
[![Code Climate](https://codeclimate.com/github/fullscreeninc/
|
7
|
+
[![Dependency Status](https://gemnasium.com/fullscreeninc/googol.png)](https://gemnasium.com/fullscreeninc/googol)
|
8
|
+
[![Build Status](https://travis-ci.org/fullscreeninc/googol.png?branch=master)](https://travis-ci.org/fullscreeninc/googol)
|
9
|
+
[![Coverage Status](https://coveralls.io/repos/fullscreeninc/googol/badge.png)](https://coveralls.io/r/fullscreeninc/googol)
|
10
|
+
[![Code Climate](https://codeclimate.com/github/fullscreeninc/googol.png)](https://codeclimate.com/github/fullscreeninc/googol)
|
11
11
|
|
12
12
|
After [registering your app], you can run commands like:
|
13
13
|
|
@@ -276,7 +276,7 @@ To install on your system, run
|
|
276
276
|
|
277
277
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
278
278
|
|
279
|
-
gem 'yt', '~> 0.4.
|
279
|
+
gem 'yt', '~> 0.4.4'
|
280
280
|
|
281
281
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
282
282
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
@@ -19,7 +19,10 @@ module Yt
|
|
19
19
|
list.find_all do |item|
|
20
20
|
params.all? do |method, value|
|
21
21
|
# TODO: could be symbol etc...
|
22
|
-
item.respond_to?(method) &&
|
22
|
+
item.respond_to?(method) && case value
|
23
|
+
when Regexp then item.send(method) =~ value
|
24
|
+
else item.send(method) == value
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
end
|
@@ -16,22 +16,18 @@ module Yt
|
|
16
16
|
|
17
17
|
def subscribe
|
18
18
|
subscriptions.insert ignore_duplicates: true
|
19
|
-
subscribed?
|
20
19
|
end
|
21
20
|
|
22
21
|
def subscribe!
|
23
22
|
subscriptions.insert
|
24
|
-
subscribed?
|
25
23
|
end
|
26
24
|
|
27
25
|
def unsubscribe
|
28
26
|
subscriptions.delete_all({}, ignore_not_found: true)
|
29
|
-
!subscribed?
|
30
27
|
end
|
31
28
|
|
32
29
|
def unsubscribe!
|
33
30
|
subscriptions.delete_all
|
34
|
-
!subscribed?
|
35
31
|
end
|
36
32
|
end
|
37
33
|
end
|
@@ -36,7 +36,7 @@ module Yt
|
|
36
36
|
# To overcome this, if we have just updated the subscription, we must
|
37
37
|
# wait some time before requesting it again.
|
38
38
|
#
|
39
|
-
def throttle(seconds =
|
39
|
+
def throttle(seconds = 10)
|
40
40
|
@last_changed_at ||= Time.now - seconds
|
41
41
|
wait = [@last_changed_at - Time.now + seconds, 0].max
|
42
42
|
sleep wait
|
data/lib/yt/version.rb
CHANGED
@@ -36,7 +36,7 @@ describe Yt::Associations::PlaylistItems, scenario: :device_app do
|
|
36
36
|
let(:video_id) { 'MESycYJytkU' }
|
37
37
|
before { @playlist.add_video video_id }
|
38
38
|
|
39
|
-
it { expect(@playlist.delete_playlist_items.
|
39
|
+
it { expect(@playlist.delete_playlist_items.uniq).to eq [true] }
|
40
40
|
it { expect{@playlist.delete_playlist_items}.to change{@playlist.playlist_items.count} }
|
41
41
|
end
|
42
42
|
end
|
@@ -25,6 +25,7 @@ describe Yt::Associations::Playlists, scenario: :device_app do
|
|
25
25
|
let(:params) { {title: "Yt Test Delete Playlist #{rand}" } }
|
26
26
|
before { account.create_playlist params }
|
27
27
|
|
28
|
+
it { expect(account.delete_playlists title: %r{#{params[:title]}}).to eq [true] }
|
28
29
|
it { expect(account.delete_playlists params).to eq [true] }
|
29
30
|
it { expect{account.delete_playlists params}.to change{account.playlists.count}.by(-1) }
|
30
31
|
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.4.
|
4
|
+
version: 0.4.4
|
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-05-
|
11
|
+
date: 2014-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|