packlink_lite 0.2.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -3
- data/lib/packlink_lite.rb +4 -4
- data/lib/packlink_lite/client.rb +8 -3
- data/lib/packlink_lite/configuration.rb +1 -1
- data/lib/packlink_lite/version.rb +1 -1
- data/packlink_lite.gemspec +7 -7
- metadata +27 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b0a8ac0008b13809fbfc4244b9f544736b62875d561e477e10f35590451a8309
|
4
|
+
data.tar.gz: 5883d2a574d8b23599c48e276903fe9634b1fdd27767c80da10218314db7b134
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f98d79dc03af172268ac3443edc92a6e5b46de487d37fcd8bdba300db194fcfd69bb737013f4f3b96c70146ee350b0e52f3570883ca6b45606e8d2978f8bc61b
|
7
|
+
data.tar.gz: db22020ae99136941f7613ef2acef4b804b1f351fbae474dc195ba8aa84c58821f30cbcafecec7fd3de60d0de899dfc913ab03aeb4b9deb05dd45d7476f06de4
|
data/.travis.yml
CHANGED
data/lib/packlink_lite.rb
CHANGED
@@ -30,11 +30,11 @@ module PacklinkLite
|
|
30
30
|
config.testing? ? SANDBOX_URL : PRODUCTION_URL
|
31
31
|
end
|
32
32
|
|
33
|
-
def change_shipment_callback_url(url)
|
34
|
-
client.post('shipments/callback', { url: url }, parse_response: false)
|
33
|
+
def change_shipment_callback_url(url, options = {})
|
34
|
+
client.post('shipments/callback', { url: url }, options.merge(parse_response: false))
|
35
35
|
end
|
36
36
|
|
37
|
-
def change_tracking_callback_url(url)
|
38
|
-
client.post('shipments/tracking_callback', { url: url }, parse_response: false)
|
37
|
+
def change_tracking_callback_url(url, options = {})
|
38
|
+
client.post('shipments/tracking_callback', { url: url }, options.merge(parse_response: false))
|
39
39
|
end
|
40
40
|
end
|
data/lib/packlink_lite/client.rb
CHANGED
@@ -29,13 +29,19 @@ module PacklinkLite
|
|
29
29
|
def with_error_handling
|
30
30
|
yield
|
31
31
|
rescue Faraday::ClientError => e
|
32
|
-
message = extract_error_message(e.response[:body])
|
32
|
+
message = extract_error_message(e.response[:body]) if e.response
|
33
|
+
message ||= e.message
|
34
|
+
|
33
35
|
raise(Error, message)
|
34
36
|
end
|
35
37
|
|
36
38
|
def connection(api_key)
|
39
|
+
token = api_key || PacklinkLite.config.api_key
|
40
|
+
|
41
|
+
raise(Error, 'API key is not set') unless token
|
42
|
+
|
37
43
|
@connection ||= build_connection
|
38
|
-
@connection.headers['Authorization'] =
|
44
|
+
@connection.headers['Authorization'] = token
|
39
45
|
@connection
|
40
46
|
end
|
41
47
|
|
@@ -44,7 +50,6 @@ module PacklinkLite
|
|
44
50
|
builder.options[:timeout] = config.timeout
|
45
51
|
builder.options[:open_timeout] = config.timeout
|
46
52
|
|
47
|
-
builder.request :retry
|
48
53
|
builder.request :json
|
49
54
|
|
50
55
|
builder.headers['Accept'] = 'application/json'
|
data/packlink_lite.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_dependency 'faraday', '~> 0
|
23
|
-
spec.add_dependency 'faraday_middleware', '~> 0
|
22
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
23
|
+
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'bundler'
|
26
|
-
spec.add_development_dependency 'rake'
|
27
|
-
spec.add_development_dependency 'rspec'
|
28
|
-
spec.add_development_dependency 'dotenv'
|
29
|
-
spec.add_development_dependency 'webmock'
|
25
|
+
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'rake'
|
27
|
+
spec.add_development_dependency 'rspec'
|
28
|
+
spec.add_development_dependency 'dotenv'
|
29
|
+
spec.add_development_dependency 'webmock'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packlink_lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurynas Butkus
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,98 +16,98 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: dotenv
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: webmock
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
description: Client to access packlink.com shipping API
|
112
112
|
email:
|
113
113
|
- laurynas.butkus@gmail.com
|
@@ -154,8 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
|
158
|
-
rubygems_version: 2.4.5
|
157
|
+
rubygems_version: 3.0.3
|
159
158
|
signing_key:
|
160
159
|
specification_version: 4
|
161
160
|
summary: Packlink.com API client
|