active-campaign-simple 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e985487ca78df3e1c59d3ab2797a88b166c84a05f4624e22584827619ff531c6
4
- data.tar.gz: 6bd4487f7ec7b4056c721d01f2d7e74bb069ffc53fc130915bd9cd9db9c3deb3
3
+ metadata.gz: b1e11e679f32384e64051c27b84b761840e99c412c67af13d5c7a48815097689
4
+ data.tar.gz: 954d8b69e0e49291aa229348bf644e81be3d937a64f7fa7fed16acbd8b0b944b
5
5
  SHA512:
6
- metadata.gz: 7816983565ec399b90bb211f551ac7a5d3ca43519dc00c98b6958fc93e184fd22d3b7cfdcc9eedcc3757bed63fbc1000183079c8f18b0577ee5a1d4302bd8f7b
7
- data.tar.gz: d916285c529751f1636e3225958f4f09cb162f4ebd6ae0b0ef5471b0a3899137776a8da748682b82097357e808bf1e4e1ae04be07a6b758f3dd84b672769a2f7
6
+ metadata.gz: 0ee9eeeded8c7cfd774cfac05ef69b23464b94d7b7a1668534e98434a13dde533fb95d326904be87c1cc8c7270b3fbe03fd3f1047c1a17fbbc9bc28ed757d633
7
+ data.tar.gz: f33762ac2f49b09846f53dffeb7c703987e09c8c947b77fbd8e2d6178a52781298059bb7f8595be61b32dac25adb0dc1337daaf1f93e2a2d84818f76801b1515
data/README.md CHANGED
@@ -3,7 +3,7 @@ Simple Ruby REST wrapper for the Active Campaign API
3
3
 
4
4
 
5
5
  ## <a name="info">Info</a>
6
- This is a very simple wrapper around the REST ActiveCampaign API. You will still need to provide the path and the payload for each request. Eventually I will grow this out to be more convenient. Right now this just provides some conveniences and an easy way to configure the API and not much more... hence the name active-campaign-simple :)
6
+ This is a very simple wrapper around the REST ActiveCampaign API. You will still need to provide the path and the payload for each request. Eventually I will grow this out to be more convenient, if needed. Right now, this just provides some conveniences and an easy way to configure the API and not much more... hence the name active-campaign-simple :)
7
7
 
8
8
  Use the public API as a guide for paths (urls) and payload info: https://developers.activecampaign.com/
9
9
 
@@ -31,7 +31,7 @@ end
31
31
  ActiveCampaign.get('/contacts')
32
32
 
33
33
  # Get a contact
34
- ActiveCampaign.get('/contacts' + id)
34
+ ActiveCampaign.get('/contacts/' + id)
35
35
 
36
36
  # Create a new contact
37
37
  # https://developers.activecampaign.com/reference#create-a-contact-new
@@ -67,10 +67,10 @@ payload = {
67
67
  },
68
68
  }
69
69
  }
70
- ActiveCampaign.post('/contacts' + id, payload: payload)
70
+ ActiveCampaign.post('/contacts/' + id, payload: payload)
71
71
 
72
72
  # Delete a contact
73
- ActiveCampaign.delete('/contacts' + id)
73
+ ActiveCampaign.delete('/contacts/' + id)
74
74
  ```
75
75
 
76
76
  ## <a name="contributing">Contributing</a>
@@ -0,0 +1,11 @@
1
+ module ActiveCampaign
2
+
3
+ class APIError < StandardError
4
+ def initialize(msg)
5
+ ActiveCampaign.api_logger.error "ERROR: #{msg}"
6
+ super(msg)
7
+ end
8
+ end
9
+
10
+ end
11
+
@@ -1,4 +1,5 @@
1
1
  require 'rest-client'
2
+ require 'active-campaign-simple/api_error'
2
3
 
3
4
  module ActiveCampaign
4
5
  module Request
@@ -46,6 +47,7 @@ module ActiveCampaign
46
47
  resp = RestClient::Request.execute(opts)
47
48
  rescue RestClient::ExceptionWithResponse => err
48
49
  # log error?
50
+ raise APIError, err
49
51
  else
50
52
  return JSON.parse(resp.body) if resp.body # Some calls respond w nothing
51
53
  end
@@ -1,4 +1,4 @@
1
1
  module ActiveCampaign
2
2
  # The version of the gem
3
- VERSION = '0.1.0'.freeze unless defined?(::ActiveCampaign::VERSION)
4
- end
3
+ VERSION = '0.1.1'.freeze unless defined?(::ActiveCampaign::VERSION)
4
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-campaign-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-09 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -51,6 +51,7 @@ files:
51
51
  - README.md
52
52
  - active-campaign-simple.gemspec
53
53
  - lib/active-campaign-simple.rb
54
+ - lib/active-campaign-simple/api_error.rb
54
55
  - lib/active-campaign-simple/client.rb
55
56
  - lib/active-campaign-simple/config.rb
56
57
  - lib/active-campaign-simple/logger.rb
@@ -75,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
76
  - !ruby/object:Gem::Version
76
77
  version: 3.0.0
77
78
  requirements: []
78
- rubygems_version: 3.2.15
79
+ rubygems_version: 3.2.22
79
80
  signing_key:
80
81
  specification_version: 4
81
82
  summary: Simple Ruby REST wrapper for the ActiveCampaign API