eucalyptus 0.2.12 → 0.2.13

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: 0cc645b0082266aaf4aa0e3f9a76712783456e64
4
- data.tar.gz: 5030d9e39f9211b2b0f21a65f3d5099bffb09031
3
+ metadata.gz: 0928d347709d4f059acdb3fff1259337dca47b1a
4
+ data.tar.gz: ce0cfa1f5d9f6a2c28fb1b37174a07e6d8393c9d
5
5
  SHA512:
6
- metadata.gz: 6d5739e36e214f482ae5be83fc1fdde39f3710f9ef6905edd924af22bff73874c37af90a48c952bf4af805343db3a367de891a3be391104173c5a3f0c8596af8
7
- data.tar.gz: 868b47c197368cd19d3c9daef8da7944614b61b027ab0a94c8103f215259281794b79373875cc49860576cb4c47c1191de416784bd9da12988c4c45feabdcd2f
6
+ metadata.gz: 72c2f01af338629dbc2cbeb4e7e8d77d4a2ddc686bc9d7a35ec94922b3a1e00823fa35033fd348e0c8c37ce9fc3e233d42d464da223896124a885a3d4721aea0
7
+ data.tar.gz: 7791aa8ec3f0b226f836c02ea9db3ebafbe3766ce5ac8db952b7ee8d09098a7921ba11a00b8f674528f2d8dc48d47efc50bd39f46ed196a8aec8a28a4668f907
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.2.13
data/eucalyptus.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: eucalyptus 0.2.12 ruby lib
5
+ # stub: eucalyptus 0.2.13 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "eucalyptus"
9
- s.version = "0.2.12"
9
+ s.version = "0.2.13"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Oguz Huner"]
14
- s.date = "2015-07-01"
14
+ s.date = "2015-07-08"
15
15
  s.description = "An easy interface and abstraction to the Facebook Ads API"
16
16
  s.email = "oguzcanhuner@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -6,6 +6,17 @@ module Eucalyptus
6
6
  "customaudiences"
7
7
  end
8
8
 
9
+ def self.create(graph: Eucalyptus.graph, name:)
10
+ response = graph.put_connections(parent.id, 'customaudiences', name: name)
11
+ self.new(response)
12
+ end
13
+
14
+ def populate(emails, graph: Eucalyptus.graph)
15
+ emails = emails.collect{|email| Digest::SHA256.hexdigest(email)}
16
+ payload = {schema: "EMAIL_SHA256", data: emails}.to_json
17
+ graph.put_connections(self.id, 'users', payload: payload)
18
+ end
19
+
9
20
  def ad_sets(from_collection: AdSet.all)
10
21
  from_collection.collect do |ad_set|
11
22
  if ad_set.targeting.custom_audiences
@@ -49,6 +49,10 @@ module Eucalyptus
49
49
  graph.put_connections(self.id, "", fields)
50
50
  end
51
51
 
52
+ def delete(graph: Eucalyptus.graph)
53
+ graph.delete_object(self.id)
54
+ end
55
+
52
56
  def ads(options={})
53
57
  Ad.all(parent: self, options: options)
54
58
  end
@@ -7,6 +7,23 @@ describe Eucalyptus::CustomAudience do
7
7
  end
8
8
  end
9
9
 
10
+ describe '.create' do
11
+ it 'creats a new custom audience' do
12
+ VCR.use_cassette('create_audience') do
13
+ audience = Eucalyptus::CustomAudience.create(name: "oz-test")
14
+ end
15
+ end
16
+ end
17
+
18
+ describe '#populate' do
19
+ it 'populates an audience with a list of emails' do
20
+ VCR.use_cassette('populate_audience') do
21
+ audience = Eucalyptus::CustomAudience.create(name: "oz-test")
22
+ audience.populate(["oz@lostmy.name","dev@lostmy.name"])
23
+ end
24
+ end
25
+ end
26
+
10
27
  describe '#ad_sets' do
11
28
  it 'returns ad_sets which belong to the audience' do
12
29
  VCR.use_cassette('audience_ad_sets') do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eucalyptus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oguz Huner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: koala