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 +4 -4
- data/VERSION +1 -1
- data/eucalyptus.gemspec +3 -3
- data/lib/eucalyptus/custom_audience.rb +11 -0
- data/lib/eucalyptus/resource.rb +4 -0
- data/spec/eucalyptus/custom_audience_spec.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0928d347709d4f059acdb3fff1259337dca47b1a
|
4
|
+
data.tar.gz: ce0cfa1f5d9f6a2c28fb1b37174a07e6d8393c9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72c2f01af338629dbc2cbeb4e7e8d77d4a2ddc686bc9d7a35ec94922b3a1e00823fa35033fd348e0c8c37ce9fc3e233d42d464da223896124a885a3d4721aea0
|
7
|
+
data.tar.gz: 7791aa8ec3f0b226f836c02ea9db3ebafbe3766ce5ac8db952b7ee8d09098a7921ba11a00b8f674528f2d8dc48d47efc50bd39f46ed196a8aec8a28a4668f907
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
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.
|
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.
|
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-
|
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
|
data/lib/eucalyptus/resource.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: koala
|