zuck 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ 0.0.9
2
+ -----
3
+ - add Zuck::TargetingSpec.valid_countries? method to allow for country
4
+ validation from the outside
5
+
1
6
  0.0.8
2
7
  -----
3
8
  - validate the countries before fetching a reach estimate
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -189,9 +189,13 @@ module Zuck
189
189
  end
190
190
 
191
191
  def validate_countries
192
- raise(InvalidCountryError, "Need to set :countries") unless @spec[:countries].present?
193
- raise(InvalidCountryError, "Must supply between 1 and 25 countries") if @spec[:countries].length > 25
194
- invalid_countries = @spec[:countries] - Zuck::ISO_COUNTRY_CODES
192
+ self.class.valid_countries?(@spec[:countries])
193
+ end
194
+
195
+ def self.valid_countries?(countries)
196
+ raise(InvalidCountryError, "Need to set :countries") unless countries.present?
197
+ raise(InvalidCountryError, "Must supply between 1 and 25 countries") if countries.length > 25
198
+ invalid_countries = countries - Zuck::ISO_COUNTRY_CODES
195
199
  return if invalid_countries.empty?
196
200
  raise(InvalidCountryError, "Invalid countrie(s): #{invalid_countries}")
197
201
  end
data/zuck.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "zuck"
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jannis Hermanns"]
12
- s.date = "2013-07-01"
12
+ s.date = "2013-07-04"
13
13
  s.description = "This gem allows to easily access facebook's ads api in ruby. See https://developers.facebook.com/docs/reference/ads-api/"
14
14
  s.email = "jannis@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: zuck
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.8
5
+ version: 0.0.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jannis Hermanns
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-01 00:00:00.000000000 Z
12
+ date: 2013-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rvm
@@ -371,7 +371,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
371
371
  - !ruby/object:Gem::Version
372
372
  segments:
373
373
  - 0
374
- hash: -4054154295877984613
374
+ hash: 2966043831358265203
375
375
  version: '0'
376
376
  none: false
377
377
  required_rubygems_version: !ruby/object:Gem::Requirement