eucalyptus 1.0.0 → 1.1.0
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 +4 -4
- data/VERSION +1 -1
- data/eucalyptus.gemspec +4 -4
- data/lib/eucalyptus/custom_audience.rb +7 -1
- data/spec/eucalyptus/custom_audience_spec.rb +12 -0
- data/spec/eucalyptus/resource_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f92bd060c086466b8c84cd5dca335acc683d6d8d
|
4
|
+
data.tar.gz: edb3d9c4d6c035a4f9e4730956703090bb9e4eec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f08a348d27b30b05e6ed518a2766767a7524b3297ca63ee353960ec27b2f784074247543d61e9c85db5e9e171fab4d7f11709b6d70e6f4570bf0ee537bccb05f
|
7
|
+
data.tar.gz: 895ade36f69a43e8fbbd998945f8cb33f5955e1137fa1896a8a32c202c92bc6802879c2add5f1d514bc15f0b9fed11364fd7ae7e42ed3c7636fe5ce709eba799
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
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 1.
|
5
|
+
# stub: eucalyptus 1.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "eucalyptus"
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.1.0"
|
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-10-
|
14
|
+
s.date = "2015-10-20"
|
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 = [
|
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
|
|
49
49
|
]
|
50
50
|
s.homepage = "http://github.com/oguzcanhuner/eucalyptus"
|
51
51
|
s.licenses = ["MIT"]
|
52
|
-
s.rubygems_version = "2.4.
|
52
|
+
s.rubygems_version = "2.4.4"
|
53
53
|
s.summary = "An easy interface and abstraction to the Facebook Ads API"
|
54
54
|
|
55
55
|
if s.respond_to? :specification_version then
|
@@ -17,6 +17,12 @@ module Eucalyptus
|
|
17
17
|
graph.put_connections(self.id, 'users', payload: payload)
|
18
18
|
end
|
19
19
|
|
20
|
+
def remove(emails, graph: Eucalyptus.graph)
|
21
|
+
emails = emails.collect{|email| Digest::SHA256.hexdigest(email)}
|
22
|
+
payload = {schema: "EMAIL_SHA256", data: emails}.to_json
|
23
|
+
graph.delete_connections(self.id, 'users', payload: payload)
|
24
|
+
end
|
25
|
+
|
20
26
|
def ad_sets(from_collection: AdSet.all)
|
21
27
|
from_collection.collect do |ad_set|
|
22
28
|
if ad_set.targeting.custom_audiences
|
@@ -26,7 +32,7 @@ module Eucalyptus
|
|
26
32
|
end
|
27
33
|
|
28
34
|
def self.known_fields
|
29
|
-
[:name, :description]
|
35
|
+
[:name, :description, :approximate_count]
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
@@ -14,6 +14,18 @@ describe Eucalyptus::CustomAudience do
|
|
14
14
|
VCR.use_cassette('populate_audience') do
|
15
15
|
audience = Eucalyptus::CustomAudience.create(name: "oz-test")
|
16
16
|
audience.populate(["oz@lostmy.name","dev@lostmy.name"])
|
17
|
+
audience.delete
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#remove' do
|
23
|
+
it 'populates an audience with a list of emails' do
|
24
|
+
VCR.use_cassette('populate_audience') do
|
25
|
+
audience = Eucalyptus::CustomAudience.create(name: "oz-test")
|
26
|
+
audience.populate(["oz@lostmy.name","dev@lostmy.name"])
|
27
|
+
audience.remove(["oz@lostmy.name","dev@lostmy.name"])
|
28
|
+
audience.delete
|
17
29
|
end
|
18
30
|
end
|
19
31
|
end
|
@@ -37,7 +37,7 @@ describe Eucalyptus::Resource do
|
|
37
37
|
it 'accepts extra fields' do
|
38
38
|
graph = double(:graph)
|
39
39
|
expect(graph).to receive(:get_object)
|
40
|
-
.with(123, {fields: [:custom_field
|
40
|
+
.with(123, {fields: [:custom_field] + Eucalyptus::CustomAudience.known_fields})
|
41
41
|
.and_return([])
|
42
42
|
|
43
43
|
Eucalyptus::CustomAudience.find(123, graph: graph, fields: [:custom_field])
|
@@ -76,7 +76,7 @@ describe Eucalyptus::Resource do
|
|
76
76
|
it 'accepts custom fields' do
|
77
77
|
graph = double(:graph)
|
78
78
|
expect(graph).to receive(:get_connection)
|
79
|
-
.with(123, "customaudiences", {fields: [:custom_field
|
79
|
+
.with(123, "customaudiences", {fields: [:custom_field] + Eucalyptus::CustomAudience.known_fields})
|
80
80
|
.and_return([])
|
81
81
|
|
82
82
|
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {fields: [:custom_field]})
|
@@ -85,10 +85,10 @@ describe Eucalyptus::Resource do
|
|
85
85
|
it 'accepts any time of option' do
|
86
86
|
graph = double(:graph)
|
87
87
|
expect(graph).to receive(:get_connection)
|
88
|
-
.with(123, "customaudiences", {action_breakdowns: [:custom_field], fields:
|
88
|
+
.with(123, "customaudiences", {action_breakdowns: [:custom_field], fields: Eucalyptus::CustomAudience.known_fields})
|
89
89
|
.and_return([])
|
90
90
|
|
91
|
-
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {action_breakdowns: [:
|
91
|
+
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {action_breakdowns: [:ustom_field]})
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
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: 1.
|
4
|
+
version: 1.1.0
|
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-10-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: koala
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
193
|
rubyforge_project:
|
194
|
-
rubygems_version: 2.4.
|
194
|
+
rubygems_version: 2.4.4
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: An easy interface and abstraction to the Facebook Ads API
|