pocus 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -7
- data/lib/pocus/association.rb +1 -1
- data/lib/pocus/identity.rb +1 -1
- data/lib/pocus/resource.rb +2 -1
- data/lib/pocus/session.rb +1 -1
- 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: fcc8aee8ffa6b81d4328650db0ff7315ab8e6b8c
|
4
|
+
data.tar.gz: 622882124f046cbd1f3d0312cbe6031d679ec4e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 106e267bdee2c61e5a472d3e0e12306897b687aae7712760c677e99e66a97c3d70e6a13e021bd5a33a9cdbd659dba6d7900d5f67fba65972a02f36b30d976a20
|
7
|
+
data.tar.gz: bf96e6dad151b44400d7976551d147716f830a3b5f9a87e6207673197a4469fb8b7a5535fa267aa4e4d42c951b6f22b5339bae579e379928fa54b81e58ecccd5
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# Pocus
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/pocus.svg)](http://badge.fury.io/rb/pocus)
|
4
|
-
[![Code Climate GPA](https://codeclimate.com/github
|
5
|
-
[![Code Climate Coverage](https://codeclimate.com/github
|
6
|
-
[![Gemnasium Status](https://gemnasium.com
|
7
|
-
[![Travis CI Status](https://secure.travis-ci.org
|
4
|
+
[![Code Climate GPA](https://codeclimate.com/github/varyonic/pocus.svg)](https://codeclimate.com/github/varyonic/pocus)
|
5
|
+
[![Code Climate Coverage](https://codeclimate.com/github/varyonic/pocus/coverage.svg)](https://codeclimate.com/github/varyonic/pocus)
|
6
|
+
[![Gemnasium Status](https://gemnasium.com/varyonic/pocus.svg)](https://gemnasium.com/varyonic/pocus)
|
7
|
+
[![Travis CI Status](https://secure.travis-ci.org/varyonic/pocus.svg)](https://travis-ci.org/varyonic/pocus)
|
8
|
+
|
9
|
+
Unofficial Ruby API client for [iContact API](See https://www.icontact.com/developerportal) (f.k.a. Vocus), inspired by Active Resource.
|
8
10
|
|
9
11
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
10
12
|
|
@@ -26,8 +28,6 @@
|
|
26
28
|
|
27
29
|
# Features
|
28
30
|
|
29
|
-
Unofficial Ruby API client for [iContact API](See https://www.icontact.com/developerportal), fka. Vocus
|
30
|
-
|
31
31
|
# Requirements
|
32
32
|
|
33
33
|
0. [MRI 2.3.0](https://www.ruby-lang.org)
|
@@ -52,6 +52,16 @@ Add the following to your Gemfile:
|
|
52
52
|
|
53
53
|
# Usage
|
54
54
|
|
55
|
+
Example:
|
56
|
+
|
57
|
+
```
|
58
|
+
Pocus::Session.config(credentials)
|
59
|
+
Pocus::Session.instance.logger = Rails.logger
|
60
|
+
account = Pocus::Account.new(account_id: account_id)
|
61
|
+
folder = acount.clientfolders.find(folder_id)
|
62
|
+
folder.contacts.create(contacts_data)
|
63
|
+
```
|
64
|
+
|
55
65
|
# Tests
|
56
66
|
|
57
67
|
To run the tests you will need your own iContact account with a test folder. Populate ~/.pocus/fixtures.yml as follows:
|
@@ -97,4 +107,4 @@ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
|
97
107
|
|
98
108
|
# Credits
|
99
109
|
|
100
|
-
Developed by [Piers Chambers](
|
110
|
+
Developed by [Piers Chambers](http://varyonic.github.io/) at [Varyonic](https://www.varyonic.com).
|
data/lib/pocus/association.rb
CHANGED
data/lib/pocus/identity.rb
CHANGED
data/lib/pocus/resource.rb
CHANGED
@@ -72,7 +72,8 @@ module Pocus
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def get_multiple(request_path, klass, filters = {})
|
75
|
-
|
75
|
+
request_data = URI.encode_www_form(camelize_fields filters)
|
76
|
+
response = session.send_request('GET', path + request_path + '?' + request_data)
|
76
77
|
data = response.fetch(klass.tag_multiple)
|
77
78
|
resources = data.map { |fields| klass.new(fields.merge(parent: self)) }
|
78
79
|
ResponseArray.new(resources, response['errors'], response['warnings'])
|
data/lib/pocus/session.rb
CHANGED
@@ -67,7 +67,7 @@ module Pocus
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def log_request_response(uri, method, data)
|
70
|
-
logger.info "request = #{uri}#{data ? '?' + data : ''}"
|
70
|
+
logger.info "request = #{method} #{uri}#{data ? '?' + data : ''}"
|
71
71
|
response = nil
|
72
72
|
tms = Benchmark.measure do
|
73
73
|
response = yield uri, method, data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piers Chambers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|