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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 792b1982fc7726054176fd18b68d1f4332fc379a
4
- data.tar.gz: 9a3c08e7031706139819c04284dbb3af3239e81a
3
+ metadata.gz: 4fe44dc454cc59b8d2d6dbb940704f004208c935
4
+ data.tar.gz: 155dc1491d986ff2e1299088766e7f25731bf314
5
5
  SHA512:
6
- metadata.gz: 53765396c8d2efe89f8a1b7339b0517460f3377d7acad07d2da1c8a9816d199b9e322f40cef728d44539f97a7d460e81646cfacd75648d037a35d460fd7f61a7
7
- data.tar.gz: 11fbd96bde1318bc5ba4e72afb9f6b99ae633a8f4b854835269c5a884ce94552f24a87c30ebed68ecacc382a819f33d07ff2f8b07558ea5747d6596dbc4a9b5c
6
+ metadata.gz: 09ea630bf75f3d65d83aea52f1c6126bf96e81e9a483c60cf5a575d73b2ff2a57ea879d0d4915479aa158198196684b98ba52f3c9676bf7b985dbc24e44ef124
7
+ data.tar.gz: 2d842bc0e8c7cc5d522d9dacf482a02e11ec0e761710a05d08f3303a3b4cd35e873f1050771abcd37d80f48fe3a3a92b8df95f080a416691575e2bf863ffbfce
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- yt (0.4.3)
4
+ yt (0.4.4)
5
5
  activesupport
6
6
 
7
7
  GEM
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/yt.png)](https://gemnasium.com/fullscreeninc/yt)
8
- [![Build Status](https://travis-ci.org/fullscreeninc/yt.png?branch=master)](https://travis-ci.org/fullscreeninc/yt)
9
- [![Coverage Status](https://coveralls.io/repos/fullscreeninc/yt/badge.png)](https://coveralls.io/r/fullscreeninc/yt)
10
- [![Code Climate](https://codeclimate.com/github/fullscreeninc/yt.png)](https://codeclimate.com/github/fullscreeninc/yt)
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.3'
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) && item.send(method) =~ value
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 = 9)
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
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.4.3'
2
+ VERSION = '0.4.4'
3
3
  end
@@ -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.compact).to eq [true] }
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.3
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-09 00:00:00.000000000 Z
11
+ date: 2014-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport