active-campaign-rails 0.1.0 → 0.2.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/.rspec +2 -0
- data/README.md +2 -0
- data/active-campaign-rails.gemspec +2 -1
- data/lib/active-campaign-rails.rb +8 -3
- data/lib/active-campaign-rails/version.rb +1 -1
- data/spec/active_campaign_spec.rb +5 -0
- data/spec/spec_helper.rb +8 -0
- metadata +25 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dad4dc80ab58f2d328dac303d9a003b2086401a
|
4
|
+
data.tar.gz: 1496052ce858013ff6d43ab5728795e20d557547
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d383252f3a3a84c365ff0e60c25f4b012620af68a16a02bb65286b9d3f159243f9c60aad1c42c37abc36b07f52096766a79cba3ac42e2007bb7de9706af26371
|
7
|
+
data.tar.gz: 9b12cda8dfc61cf1b2fa59abbdf7bcce4327ced6143bb6207e782c17a67634db66ab9be154feacb2aa7c6220bbf3b291396d9272d4a6f6c026327a0f1d0e816d
|
data/.rspec
ADDED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Simple gem for ActiveCampaign API wrapper
|
4
4
|
|
5
|
+
[](https://semaphoreci.com/ekyfauzi/active-campaign-rails)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["ekyfauzi@hotmail.com"]
|
11
11
|
spec.summary = %q{Simple rails wrapper for ActiveCampaign API}
|
12
12
|
spec.description = %q{See http://www.activecampaign.com/api/overview.php for more information}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/ekyfauzi/active-campaign-rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 0"
|
23
24
|
spec.required_ruby_version = '>= 2.0.0'
|
24
25
|
|
25
26
|
end
|
@@ -8,7 +8,7 @@ class ActiveCampaign
|
|
8
8
|
|
9
9
|
attr_reader :api_endpoint, :api_key
|
10
10
|
|
11
|
-
def initialize
|
11
|
+
def initialize(args)
|
12
12
|
|
13
13
|
# Parse args into instance_variable
|
14
14
|
args.each do |k,v|
|
@@ -24,14 +24,14 @@ class ActiveCampaign
|
|
24
24
|
def method_missing(api_action, *args, &block)
|
25
25
|
|
26
26
|
# Generate api_url
|
27
|
-
api_url =
|
27
|
+
api_url = generate_api_url()
|
28
28
|
|
29
29
|
# Check method for api_action given
|
30
30
|
case action_calls[api_action][:method]
|
31
31
|
when 'get'
|
32
32
|
|
33
33
|
# Generate API parameter from given argument
|
34
|
-
api_params = (args.present?) ? args.first.map{|k,v| "#{k}=#{v}"}.join('
|
34
|
+
api_params = (args.present?) ? args.first.map{|k,v| "#{k}=#{v}"}.join('&') : nil
|
35
35
|
|
36
36
|
# Join API url and API parameters
|
37
37
|
api_url = (api_params.present?) ? "#{api_url}&#{api_params}" : api_url
|
@@ -59,4 +59,9 @@ class ActiveCampaign
|
|
59
59
|
|
60
60
|
end
|
61
61
|
|
62
|
+
private
|
63
|
+
def generate_api_url
|
64
|
+
return "#{@api_endpoint}/admin/api.php?api_key=#{@api_key}&api_action=#{api_action.to_s}&api_output=#{@api_output}"
|
65
|
+
end
|
66
|
+
|
62
67
|
end
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-campaign-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eky Fauzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: See http://www.activecampaign.com/api/overview.php for more information
|
42
56
|
email:
|
43
57
|
- ekyfauzi@hotmail.com
|
@@ -46,6 +60,7 @@ extensions: []
|
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
62
|
- ".gitignore"
|
63
|
+
- ".rspec"
|
49
64
|
- Gemfile
|
50
65
|
- LICENSE.txt
|
51
66
|
- README.md
|
@@ -54,7 +69,9 @@ files:
|
|
54
69
|
- lib/active-campaign-rails.rb
|
55
70
|
- lib/active-campaign-rails/client.rb
|
56
71
|
- lib/active-campaign-rails/version.rb
|
57
|
-
|
72
|
+
- spec/active_campaign_spec.rb
|
73
|
+
- spec/spec_helper.rb
|
74
|
+
homepage: https://github.com/ekyfauzi/active-campaign-rails
|
58
75
|
licenses:
|
59
76
|
- MIT
|
60
77
|
metadata: {}
|
@@ -74,8 +91,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
91
|
version: '0'
|
75
92
|
requirements: []
|
76
93
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.4.
|
94
|
+
rubygems_version: 2.4.8
|
78
95
|
signing_key:
|
79
96
|
specification_version: 4
|
80
97
|
summary: Simple rails wrapper for ActiveCampaign API
|
81
|
-
test_files:
|
98
|
+
test_files:
|
99
|
+
- spec/active_campaign_spec.rb
|
100
|
+
- spec/spec_helper.rb
|
101
|
+
has_rdoc:
|