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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8896dcbe66d0ba28169c9cd8f073d9b165f7bbf2
4
- data.tar.gz: 9eabcc7873c4040bdc0caee91c37b63787056b0c
3
+ metadata.gz: fcc8aee8ffa6b81d4328650db0ff7315ab8e6b8c
4
+ data.tar.gz: 622882124f046cbd1f3d0312cbe6031d679ec4e2
5
5
  SHA512:
6
- metadata.gz: b64105a21925bbfc931c664e82650c41149573074983f08674762fb5332e0bba69a5c754a1befeff2696b851363c280c4a9bf39c1270a8cf372f90786370f4b1
7
- data.tar.gz: 781724db172ae05386e1031cbac66e11704c64aa853459475f3a516e17232588e31ca43ab6997eaeb671a9fbafae92f049c1b69b95aaf29a4265c2978e873fd1
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//pocus.svg)](https://codeclimate.com/github//pocus)
5
- [![Code Climate Coverage](https://codeclimate.com/github//pocus/coverage.svg)](https://codeclimate.com/github//pocus)
6
- [![Gemnasium Status](https://gemnasium.com//pocus.svg)](https://gemnasium.com//pocus)
7
- [![Travis CI Status](https://secure.travis-ci.org//pocus.svg)](https://travis-ci.org//pocus)
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](https://www.varyonic.com) at [Varyonic](https://www.varyonic.com).
110
+ Developed by [Piers Chambers](http://varyonic.github.io/) at [Varyonic](https://www.varyonic.com).
@@ -9,7 +9,7 @@ module Pocus
9
9
  end
10
10
 
11
11
  def all
12
- owner.get_multiple(path, klass)
12
+ @all ||= owner.get_multiple(path, klass)
13
13
  end
14
14
 
15
15
  def create(fields_multiple)
@@ -12,7 +12,7 @@ module Pocus
12
12
  end
13
13
 
14
14
  def self.version
15
- '0.5.0'
15
+ '0.5.1'
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -72,7 +72,8 @@ module Pocus
72
72
  end
73
73
 
74
74
  def get_multiple(request_path, klass, filters = {})
75
- response = session.send_request('GET', path + request_path, camelize_filters(filters))
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.0
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-05-26 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler