yourub 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2aa1059c797a786fea83046d74f8bd6751f954d
4
- data.tar.gz: 7906cfcc12e3fd7e7cd82c2290f00a855c3ef8cd
3
+ metadata.gz: 11e9778e059d14cc1e3a3dfdef72de7b70d29863
4
+ data.tar.gz: fe5cbe47a3a4da2795895c91add5559acdba77be
5
5
  SHA512:
6
- metadata.gz: 3cb8c2d1c2c2ebce6e81bd0d8bcf832f0ac7365d3543e445bd3ced8c2e5049a24840e03d83684bd47725a466d277df596cd4b635c752ad1eb0747d85b5ef3f58
7
- data.tar.gz: 4533693deb7dd813670d8ec362f44e66e985f41c6233c58798b2d14b977194f9ae59112ce0b67ef9984f0305c541c67c1713346eb01bc854694882df1112e42a
6
+ metadata.gz: 22e00c1b0c489180ee6cb9a4e9aacd0358113257823c802d90d350970e5f6dab901118e13d3d7befae4418cac009a7be6b1312927f33af33be6449143be111b1
7
+ data.tar.gz: 19db03890866df4fbd49504f72a1af4b24c5e78e62965ddbff9da202a7f9a48c78a933d288ae08f2b2a8f4f8b2b6e58ed630b45c83b5e1888db1d41aea8bb854
data/README.md CHANGED
@@ -45,9 +45,9 @@ test:
45
45
 
46
46
  `:id` Sting, a valid youtube video id, example `NisCkxU544c`. If this parameter is set, tha others are ignored
47
47
 
48
- `:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`
48
+ `:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`. The default one is `US`
49
49
 
50
- `:category` String, example `comedy`
50
+ `:category` String, example `comedy`. It accept the wildcard `all`, that retrieves videos for all the category for the given nation, or the default one (US) if no one is given
51
51
 
52
52
  `:count_filter` Hash, example `{views: ">= 100"}` or `{views: "== 600"}`
53
53
 
@@ -74,7 +74,7 @@ module Yourub
74
74
  end
75
75
 
76
76
  def valid_category(categories, selected_category)
77
- #if selected_category == 'all' return categories
77
+ return categories if selected_category == 'all'
78
78
  categories = categories.select {|k| k.has_value?(selected_category.downcase)}
79
79
  if categories.first.nil?
80
80
  raise ArgumentError.new(
@@ -1,6 +1,6 @@
1
1
  module Yourub
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 8
4
+ PATCH = 9
5
5
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
6
6
  end
data/spec/client_spec.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'byebug'
1
2
  require 'yourub'
2
3
 
3
4
  describe Yourub::Client do
@@ -24,12 +25,17 @@ describe Yourub::Client do
24
25
  it "retrieves videos that have more than 100 views" do
25
26
  filter = {views: ">= 100"}
26
27
  subject.search(country: "US", category: "Sports", count_filter: filter)
27
- expect(subject.videos).to be_a_kind_of(Array)
28
+ expect(subject.videos).to_not be_empty
29
+ end
30
+
31
+ it "retrieves videos for all the categories" do
32
+ subject.search(country: "US", category: "all")
33
+ expect(subject.videos).to_not be_empty
28
34
  end
29
35
 
30
36
  it "accept an 'order' parameter within the others" do
31
37
  subject.search(country: "US", category: "Sports", order: 'date')
32
- expect(subject.videos).to be_a_kind_of(Array)
38
+ expect(subject.videos).to_not be_empty
33
39
  end
34
40
 
35
41
  it "retrieves 5 videos for each given category" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yourub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Prati
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-26 00:00:00.000000000 Z
11
+ date: 2014-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client