yourub 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yourub/validator.rb +5 -2
- data/lib/yourub/version.rb +1 -1
- data/spec/client_spec.rb +5 -0
- data/yourub.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 494ed6a9104fae3170ddc50558721f98bc42f36f
|
4
|
+
data.tar.gz: b2c160e3bf7410d175328205b2550e69e20001f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4353aefef6f549703e09bbef10387008993e3844d744528005201239e117d5f01048c7f7bdd5b343e36b5527631091df35ba9ac16b0ed3f8437199259c8d3a91
|
7
|
+
data.tar.gz: 9473dddeb12fef8f2a3d100ebd6b4dadf3fbec1c72d1db2ba5fe090fe88acbf2843d408739f29c771b91bb462b5cf38d404818b0ec7a57dab6640396ec919f82
|
data/lib/yourub/validator.rb
CHANGED
@@ -53,7 +53,10 @@ module Yourub
|
|
53
53
|
|
54
54
|
def countries_to_array
|
55
55
|
if @criteria.has_key? :country
|
56
|
-
|
56
|
+
if @criteria[:country].is_a?(String)
|
57
|
+
@criteria[:country] = @criteria[:country].split(',').collect(&:strip)
|
58
|
+
end
|
59
|
+
@criteria[:country] = @criteria[:country].to_a
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|
@@ -98,7 +101,7 @@ module Yourub
|
|
98
101
|
if @criteria.has_key? :country
|
99
102
|
raise ArgumentError.new(
|
100
103
|
"the given country is not in the available ones: #{COUNTRIES.join(',')}"
|
101
|
-
) unless( (@criteria[:country]
|
104
|
+
) unless( (@criteria[:country] - COUNTRIES).size == 0 )
|
102
105
|
end
|
103
106
|
end
|
104
107
|
|
data/lib/yourub/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -37,6 +37,11 @@ describe Yourub::Client do
|
|
37
37
|
expect(subject.videos.count).to eq(10)
|
38
38
|
end
|
39
39
|
|
40
|
+
it "retrieves 5 videos for each given category, also if they are passed as array" do
|
41
|
+
subject.search(country: ["US", "DE"], category: "Sports", max_results: 5)
|
42
|
+
expect(subject.videos.count).to eq(10)
|
43
|
+
end
|
44
|
+
|
40
45
|
it "retrieves the given number of video for the given category" do
|
41
46
|
subject.search(category: "Sports", max_results: 2)
|
42
47
|
expect(subject.videos.count).to eq(2)
|
data/yourub.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_runtime_dependency 'google-api-client', '~> 0.7'
|
22
22
|
spec.add_runtime_dependency "thor" , '~> 0.18'
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "byebug", "~> 3.1"
|
24
25
|
spec.add_development_dependency "rake", "~> 10.1"
|
25
26
|
spec.add_development_dependency "rspec", "~> 2.14"
|
26
27
|
|
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.
|
4
|
+
version: 1.0.7
|
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-
|
11
|
+
date: 2014-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-api-client
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|