active_campaign 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +0 -1
- data/Gemfile +0 -13
- data/active_campaign.gemspec +6 -0
- data/lib/active_campaign/version.rb +1 -1
- data/lib/faraday/response/json_normalizer.rb +10 -3
- data/spec/active_campaign_spec.rb +1 -0
- data/spec/client/lists_spec.rb +1 -1
- data/spec/helper.rb +9 -8
- metadata +71 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb8a4c4d0dcd0af706f254f1b0b22ebbdced39e
|
4
|
+
data.tar.gz: 7a889c0a3e2d41ee147fe6b1bdf7f8137bb684fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f681d1d03d8a1ed3cbf853e83d678309f00b60a1edf9bff7cc07223254fa5ce1c381de00ed7073dbf0ba75fedd17d5b50f8a9a880a466de65f0fcc3094a765
|
7
|
+
data.tar.gz: 313a254bcc0e488de64235564fcc3e9d52a6c71bf522627ea7f87b235eafe8d70a97c5493a7b47afb1f690e7b595dd514044703387d71ee07e936b619300483c
|
data/.rspec
CHANGED
data/Gemfile
CHANGED
@@ -1,16 +1,3 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
gem 'rake'
|
3
|
-
gem 'yard'
|
4
|
-
|
5
|
-
|
6
|
-
group :test do
|
7
|
-
gem 'coveralls', require: false
|
8
|
-
gem 'guard-rspec'
|
9
|
-
gem 'json', '~> 1.7', :platforms => [:ruby_18, :jruby]
|
10
|
-
gem 'rspec', '>= 2.13'
|
11
|
-
gem 'simplecov', require: false
|
12
|
-
gem 'webmock'
|
13
|
-
gem 'test-queue'
|
14
|
-
end
|
15
2
|
|
16
3
|
gemspec
|
data/active_campaign.gemspec
CHANGED
@@ -24,4 +24,10 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "faraday", "~> 0.8"
|
25
25
|
spec.add_dependency "faraday_middleware", "~> 0.9"
|
26
26
|
spec.add_dependency "multi_json", "~> 1.7"
|
27
|
+
spec.add_dependency 'rake'
|
28
|
+
|
29
|
+
spec.add_development_dependency 'json', '~> 1.7'
|
30
|
+
spec.add_development_dependency 'rspec', '>= 2.14'
|
31
|
+
spec.add_development_dependency 'webmock'
|
32
|
+
spec.add_development_dependency "pry"
|
27
33
|
end
|
@@ -19,13 +19,20 @@ module Faraday
|
|
19
19
|
|
20
20
|
def normalize(response)
|
21
21
|
keys, values = keys_values(response)
|
22
|
-
|
23
|
-
keys.
|
24
|
-
response
|
22
|
+
|
23
|
+
if keys.all?{|key| is_numeric?(key) }
|
24
|
+
response[:results] = values
|
25
|
+
keys.each do |key|
|
26
|
+
response.delete(key)
|
27
|
+
end
|
25
28
|
end
|
26
29
|
response
|
27
30
|
end
|
28
31
|
|
32
|
+
def is_numeric?(string)
|
33
|
+
string.to_s.match(/\A[+-]?\d+\Z/) == nil ? false : true
|
34
|
+
end
|
35
|
+
|
29
36
|
def keys_values(response)
|
30
37
|
results = results(response)
|
31
38
|
[results.keys, results.values]
|
@@ -21,6 +21,7 @@ describe ActiveCampaign do
|
|
21
21
|
describe ".delegate" do
|
22
22
|
it "delegates missing methods to ActiveCampaign::Client" do
|
23
23
|
initialize_active_campaign
|
24
|
+
|
24
25
|
stub_get("contact_view", email: "mikael@zoolutions.se").
|
25
26
|
to_return json_response('contact_view.json')
|
26
27
|
contact = ActiveCampaign.contact_view(email: "mikael@zoolutions.se")
|
data/spec/client/lists_spec.rb
CHANGED
@@ -35,7 +35,7 @@ describe ActiveCampaign::Client::Lists do
|
|
35
35
|
expect(list.name).to eq "Swedish Players"
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
pending "returns the right list list" do
|
39
39
|
WebMock.allow_net_connect!
|
40
40
|
# stub_get("list_view", name: "Swedish Players").
|
41
41
|
# to_return json_response("list_view.json")
|
data/spec/helper.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
require 'simplecov'
|
2
|
-
require 'coveralls'
|
1
|
+
# require 'simplecov'
|
2
|
+
# require 'coveralls'
|
3
3
|
|
4
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
-
|
6
|
-
|
7
|
-
]
|
8
|
-
SimpleCov.start
|
4
|
+
# SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
+
# SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
# Coveralls::SimpleCov::Formatter
|
7
|
+
# ]
|
8
|
+
# SimpleCov.start
|
9
9
|
|
10
10
|
require "active_campaign"
|
11
11
|
require 'rspec'
|
12
12
|
require 'webmock/rspec'
|
13
|
+
require 'pry'
|
13
14
|
|
14
15
|
WebMock.disable_net_connect!(:allow => 'coveralls.io')
|
15
16
|
|
@@ -88,7 +89,7 @@ def active_campaign_url(url, options = {})
|
|
88
89
|
if url =~ /^http/
|
89
90
|
url
|
90
91
|
else
|
91
|
-
uri = "https://yourdomain.activehosted.com/admin/api.php?api_action=#{url}&api_key=YOURAPIKEY&api_output=
|
92
|
+
uri = "https://yourdomain.activehosted.com/admin/api.php?api_action=#{url}&api_key=YOURAPIKEY&api_output=json"
|
92
93
|
params = options.map{|k,v| "#{k}=#{v}" }.join("&")
|
93
94
|
"#{uri}&#{params}"
|
94
95
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_campaign
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
@@ -94,6 +94,76 @@ dependencies:
|
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: json
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.7'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.7'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.14'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.14'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: webmock
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
97
167
|
description: A simple ruby wrapper for the ActiveCampaign API
|
98
168
|
email:
|
99
169
|
- mikael@zoolutions.se
|