eucalyptus 0.2.0 → 0.2.1
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/insight.rb +3 -1
- data/lib/eucalyptus/resource.rb +8 -4
- data/spec/eucalyptus/resource_spec.rb +16 -2
- 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: dfecbf0a699698a9c6362b12255eff693caa53c8
|
4
|
+
data.tar.gz: 392a295912a4ef2c71eef00f25977077a17a1ba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a026a339a283c1eb065ad683d6cf71d5603c07dcee232aed76cae55a43b968bd4b77f4934a939e2fbb57336bcb21c16a918fba08ea757e3cb97525d0fa8b647c
|
7
|
+
data.tar.gz: d45520e1b6812ba36a5b0dd43838b9d872922e3357078ceb32fb8c7f8767447c86452045a8a934a86d362150c190eaa5e5469f17df3020cdc85b0ab102b254ef
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
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.1 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.1"
|
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-06-
|
14
|
+
s.date = "2015-06-25"
|
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 = [
|
data/lib/eucalyptus/insight.rb
CHANGED
data/lib/eucalyptus/resource.rb
CHANGED
@@ -19,10 +19,14 @@ module Eucalyptus
|
|
19
19
|
self.new(response)
|
20
20
|
end
|
21
21
|
|
22
|
-
def self.all(graph: Eucalyptus.graph, parent: self.parent,
|
23
|
-
fields
|
24
|
-
|
25
|
-
|
22
|
+
def self.all(graph: Eucalyptus.graph, parent: self.parent, options: {})
|
23
|
+
if options[:fields]
|
24
|
+
options[:fields].concat(self.known_fields).uniq
|
25
|
+
else
|
26
|
+
options[:fields] = self.known_fields
|
27
|
+
end
|
28
|
+
|
29
|
+
response = graph.get_connection(parent.id, api_path, options)
|
26
30
|
response.collect{ |res| self.new(res) }
|
27
31
|
end
|
28
32
|
|
@@ -79,17 +79,31 @@ describe Eucalyptus::Resource do
|
|
79
79
|
expect(audiences.first).to_not respond_to :random_method
|
80
80
|
end
|
81
81
|
|
82
|
-
it 'accepts
|
82
|
+
it 'accepts custom fields' do
|
83
83
|
graph = double(:graph)
|
84
84
|
expect(graph).to receive(:get_connection)
|
85
85
|
.with(123, "customaudiences", {fields: [:custom_field, :name, :description]})
|
86
86
|
.and_return([])
|
87
87
|
|
88
|
-
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, fields: [:custom_field])
|
88
|
+
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {fields: [:custom_field]})
|
89
|
+
end
|
90
|
+
|
91
|
+
it 'accepts any time of option' do
|
92
|
+
graph = double(:graph)
|
93
|
+
expect(graph).to receive(:get_connection)
|
94
|
+
.with(123, "customaudiences", {action_breakdowns: [:custom_field], fields: [:name, :description]})
|
95
|
+
.and_return([])
|
96
|
+
|
97
|
+
Eucalyptus::CustomAudience.all(graph: graph, parent: parent, options: {action_breakdowns: [:custom_field]})
|
89
98
|
end
|
90
99
|
end
|
91
100
|
end
|
92
101
|
|
102
|
+
describe '#update' do
|
103
|
+
it 'updates a resource' do
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
93
107
|
describe '#method_missing' do
|
94
108
|
let(:response) { { "id" => "123", "name" => "Audience", "stats" => {"cpa" => "12"} }}
|
95
109
|
let(:resource) { Eucalyptus::CustomAudience.new(response) }
|
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.1
|
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-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: koala
|