parcel_api 0.2.0 → 0.3.0

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: 796b5726fcf645a3a08bc3f3604571543204838a
4
- data.tar.gz: 0aa5d2dec24519e44ac578819d6604a3d86b31df
3
+ metadata.gz: 8886894ef43031aeafa7be11485949babafb4223
4
+ data.tar.gz: 23d57ce931ecfc5ceb8003616fcea3086c2de173
5
5
  SHA512:
6
- metadata.gz: a1719f6f35ac57609e2f3e142e82a0ff3e42f43bc29e9fcb40e935e00052e752995afbc19019426c52d3f77bd4b6de3522cad0159068c428e3314ea37cd56682
7
- data.tar.gz: 214072e0c14a216fae2947d0faaecf01c1ab4b4c272f1c96c5f8565a13c5cbb6f0f3ad4d02bd8804241e7a97a374ad0edb23f1fc80ec3b97ff438aa9e765f900
6
+ metadata.gz: 286890d8608d3ad0405434d5ebbe77db99b28af210aa4d022ae3ee1118a89e829aa04256a2abc4f50e965f7fa1ec22a43ebea2c7690a0d5c213eecc2330c55e3
7
+ data.tar.gz: b4c4d96bd37dd8e4e97d03bd7d872c58c126dd90e8bf46d8ecd4b406e87a123cc80112471467d304bdc42456c00f171e52d432a40b633320be0b7716fd5e8108
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parcel_api (0.2.0)
4
+ parcel_api (0.3.0)
5
5
  faraday (~> 0.9)
6
6
  faraday_middleware (~> 0.9)
7
7
  oauth2 (~> 1.0)
@@ -19,28 +19,28 @@ GEM
19
19
  safe_yaml (~> 1.0.0)
20
20
  diff-lcs (1.2.5)
21
21
  docile (1.1.5)
22
- faraday (0.9.1)
22
+ faraday (0.9.2)
23
23
  multipart-post (>= 1.2, < 3)
24
- faraday_middleware (0.9.1)
24
+ faraday_middleware (0.10.0)
25
25
  faraday (>= 0.7.4, < 0.10)
26
- jwt (1.5.0)
26
+ jwt (1.5.1)
27
27
  method_source (0.8.2)
28
28
  multi_json (1.11.0)
29
29
  multi_xml (0.5.5)
30
30
  multipart-post (2.0.0)
31
- oauth2 (1.0.0)
31
+ oauth2 (1.1.0)
32
32
  faraday (>= 0.8, < 0.10)
33
- jwt (~> 1.0)
33
+ jwt (~> 1.0, < 1.5.2)
34
34
  multi_json (~> 1.3)
35
35
  multi_xml (~> 0.5)
36
- rack (~> 1.2)
36
+ rack (>= 1.2, < 3)
37
37
  pry (0.10.1)
38
38
  coderay (~> 1.1.0)
39
39
  method_source (~> 0.8.1)
40
40
  slop (~> 3.4)
41
41
  rack (1.6.4)
42
42
  rake (10.4.2)
43
- recursive-open-struct (0.6.4)
43
+ recursive-open-struct (0.6.5)
44
44
  rspec (3.2.0)
45
45
  rspec-core (~> 3.2.0)
46
46
  rspec-expectations (~> 3.2.0)
@@ -81,3 +81,6 @@ DEPENDENCIES
81
81
  vcr (~> 2.9)
82
82
  webmock (~> 1.21)
83
83
  yard (~> 0.8)
84
+
85
+ BUNDLED WITH
86
+ 1.11.2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ParcelApi
2
2
 
3
- [![RubyGem](https://badge.fury.io/rb/parcel_api.svg)](https://rubygems.org/gems/parcel_api)[![Build Status](https://magnum.travis-ci.com/etailer/parcel_api.svg?token=hCq9S5vXdep6iBazZLuu)](https://magnum.travis-ci.com/etailer/parcel_api) [![Code Climate](https://codeclimate.com/repos/552dc72e69568025e8001d73/badges/d0ccddbcdb28ce0d2834/gpa.svg)](https://codeclimate.com/repos/552dc72e69568025e8001d73/feed) [![Test Coverage](https://codeclimate.com/repos/552dc72e69568025e8001d73/badges/d0ccddbcdb28ce0d2834/coverage.svg)](https://codeclimate.com/repos/552dc72e69568025e8001d73/feed)
3
+ [![RubyGem](https://badge.fury.io/rb/parcel_api.svg)](https://rubygems.org/gems/parcel_api) [![Build Status](https://travis-ci.org/etailer/parcel_api.svg)](https://travis-ci.org/etailer/parcel_api) [![Code Climate](https://codeclimate.com/repos/552dc72e69568025e8001d73/badges/d0ccddbcdb28ce0d2834/gpa.svg)](https://codeclimate.com/repos/552dc72e69568025e8001d73/feed) [![Test Coverage](https://codeclimate.com/repos/552dc72e69568025e8001d73/badges/d0ccddbcdb28ce0d2834/coverage.svg)](https://codeclimate.com/repos/552dc72e69568025e8001d73/feed)
4
4
 
5
5
  Ruby wrapper for [NZ Post's Shipping APIs](https://www.nzpost.co.nz/developer-centre#parcel).
6
6
 
@@ -35,24 +35,22 @@ module ParcelApi
35
35
  private
36
36
 
37
37
  def token
38
- @token ||= begin
39
- params = {
40
- client_id: @client_id,
41
- client_secret: @client_secret,
42
- username: @username,
43
- password: @password,
44
- grant_type: 'password',
45
- }
46
-
47
- auth_api = Faraday.new do |conn|
48
- conn.request :url_encoded
49
- conn.response :json
50
- conn.use FaradayMiddleware::RaiseHttpException
51
- conn.adapter Faraday.default_adapter
52
- end
53
- response = auth_api.post @auth_address, params
54
- response.body['access_token']
38
+ params = {
39
+ client_id: @client_id,
40
+ client_secret: @client_secret,
41
+ username: @username,
42
+ password: @password,
43
+ grant_type: 'password',
44
+ }
45
+
46
+ auth_api = Faraday.new do |conn|
47
+ conn.request :url_encoded
48
+ conn.response :json
49
+ conn.use FaradayMiddleware::RaiseHttpException
50
+ conn.adapter Faraday.default_adapter
55
51
  end
52
+ response = auth_api.post @auth_address, params
53
+ response.body['access_token']
56
54
  end
57
55
 
58
56
  end
@@ -1,3 +1,3 @@
1
1
  module ParcelApi
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parcel_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Coleman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-13 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubyforge_project:
232
- rubygems_version: 2.4.5
232
+ rubygems_version: 2.5.1
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Ruby client for NZ Post's Parcel APIs