easypost 3.5.0 → 3.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
  SHA256:
3
- metadata.gz: 61c0e0c8eb25bf4d96db43cd812a71df8648e2b1a77f2eef5d651bb4c1275cbf
4
- data.tar.gz: ac36be5df27407e988d4fcc50c93a312fe8e1465cba96e85c8120d36acdfcf65
3
+ metadata.gz: c893399d43b9432c0b6812c5649ab48ad2ad1c04b6373e7999cc8c1fdf22d82b
4
+ data.tar.gz: f98230c21010af6117011b0ddee1a1bda574a821fc5ae470a85e4961e72954ef
5
5
  SHA512:
6
- metadata.gz: cd011f19406e4f5187f6daac73c490621052605610160992ce4ec42db0b9a4e1b3f64f90123f2b8a7399f32f3b54c7d6515e03c882e01acbc913d611dce9f0a2
7
- data.tar.gz: 3bb63bfce116fa8e1504cde77b38019c68bd4269770246e78aad8916b3e04e29877926550ddaf17fe5fa8489e071069a5e2b0e1432a0fdb52bc0f55e4a981af5
6
+ metadata.gz: 1822930673f844b99cc6f53ea4c5564b54342590383433ee359f4c3420d56ddbd3cc166d4d2e1975b52a848c95d6854b1b0e79245e3a9b9660ee309a795f5b99
7
+ data.tar.gz: b7fa805a9b6cc8a65b3076828f9bd5740709475b4d63824d34dc4981c9ea779af1c9eff273d546e59c7e79d0b7002f9dbbd3353d5faad2911e6615495cbec6cc
data/CHANGELOG.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.5.1 2022-07-01
4
+
5
+ * Backports newer user-agent header
3
6
 
4
7
  ## 3.5.0 2021-12-06
5
8
 
6
9
  * Adds the `update_brand` method to the user object (closes #122)
7
10
 
8
-
9
11
  ## 3.4.0 2021-07-13
10
12
 
11
13
  * Removed deprecated `Item` object
@@ -15,26 +17,22 @@
15
17
  * Adds `regenerate_rates` method for new rerate API
16
18
  * Adds `deconstruct_keys` method to allow for pattern matching on EasyPost objects
17
19
 
18
-
19
20
  ## 3.3.0 2021-06-10
20
21
 
21
22
  * Adds `SmartRate` functionality to the `Shipments` object (available by calling `get_smartrates` on a shipment)
22
23
  * Fix bug where `EasyPost::CarrierAccount.types` was hitting the wrong endpoint
23
24
 
24
-
25
25
  ## 3.2.0 2021-01-14
26
26
 
27
27
  * Replace Travis CI with Github Actions
28
28
  * Add Ruby 3.0 to supported platforms (#110; thanks @maxwell)
29
29
 
30
-
31
30
  ## 3.1.5 2020-12-16
32
31
 
33
32
  * Fix attribute lookup when manually constructing objects (#105; thanks @drewtempelmeyer)
34
33
  * Flatten class names and clean up some other style issues
35
34
  * Fix `EasyPost::Address.create_and_verify`, broken since 3.1.0 (#108; thanks @rajbirverma)
36
35
 
37
-
38
36
  ## 3.1.4 2020-09-29
39
37
 
40
38
  * Don't modify params passed into Address#create (#78; thanks @TheRusskiy)
@@ -42,206 +40,168 @@
42
40
  * When constructing an easypost object, convert the key to a string (#102; thanks @Geesu)
43
41
  * Expose the raw HTTP response as `#http_body` on `EasyPost::Error` objects (#101; thanks @Geesu)
44
42
 
45
-
46
43
  ## 3.1.3 2020-06-26
47
44
 
48
45
  * Fix bug causing Authorization header to be included in User-Agent header. All users must upgrade.
49
46
 
50
-
51
47
  ## 3.1.2 2020-06-24
52
48
 
53
49
  * Bad gem push. New version required.
54
50
 
55
-
56
51
  ## 3.1.1 2020-06-23
57
52
 
58
53
  * Fix bug where EasyPost.http_config was invalid when not explicitly initialized.
59
54
 
60
-
61
55
  ## 3.1.0 2020-06-23
62
56
 
63
57
  * Add Shipment Invoice and Refund Report
64
58
  * Remove dependencies on `RestClient` and `MultiJson`
65
59
  * Remove some deprecated endpoints
66
60
 
67
-
68
61
  ## 3.0.1 2018-05-17
69
62
 
70
63
  * Enforce TLS certificate validity by default
71
64
 
72
-
73
65
  ## 3.0.0 2018-02-15
74
66
 
75
67
  * Require use of ruby ~> 2.0 and TLSv1.2
76
68
 
77
-
78
69
  ## 2.7.3 2018-02-05
79
70
 
80
71
  * Fix bug with introduced around certain JSON objects with IDs (thanks vladvinnikov!)
81
72
 
82
-
83
73
  ## 2.7.2 2018-02-01
84
74
 
85
75
  * Removed unused and unsupported code paths for Container model
86
76
  * Removed unused and unsupported code path for Stamp and Barcode methods on the Shipment model
87
77
  * Fixed a bug with non-model JSON object with an "id" key being treated as models and raising errors
88
78
 
89
-
90
79
  ## 2.7.1 2017-05-25
91
80
 
92
81
  * Allow reports to be retrieved without passing a type
93
82
 
94
-
95
83
  ## 2.7.0 2017-04-04
96
84
 
97
85
  * Changed Report CRUD signatures. requires report type to be passed
98
86
 
99
-
100
87
  ## 2.6.2 2017-02-14
101
88
 
102
89
  * Added get_rates method for Orders
103
90
 
104
-
105
91
  ## 2.6.1 2017-01-19
106
92
 
107
93
  * Updated create method for ScanForms
108
94
 
109
-
110
95
  ## 2.6.0 2017-01-17
111
96
 
112
97
  * Add basic CRUD methods for Webhooks
113
98
 
114
-
115
99
  ## 2.5.0 2016-12-19
116
100
 
117
101
  * Add prefixes to report in utils
118
102
 
119
-
120
103
  ## 2.4.0 2016-12-08
121
104
 
122
105
  * Add report resource to ruby client
123
106
 
124
-
125
107
  ## 2.3.0 2016-11-25
126
108
 
127
109
  * Updated dependencies to allow rest-client 2.0.0 and above
128
110
 
129
-
130
111
  ## 2.2.0 2016-07-26
131
112
 
132
113
  * Added standalone Insurance model
133
114
 
134
-
135
115
  ## 2.1.11 2016-02-04
136
116
 
137
117
  * Allowed user creation for top-level users
138
118
 
139
-
140
119
  ## 2.1.10 2015-12-23
141
120
 
142
121
  * Added verify and verify_strict params to Address.create
143
122
  * Added Tracker.create_list and Tracker.all_updated for working with large
144
123
  numbers of Trackers.
145
124
 
146
-
147
125
  ## 2.1.9 2015-11-04
148
126
 
149
127
  * Added new tests for Tracker.all
150
128
  * Updated some old examples
151
129
 
152
-
153
130
  ## 2.1.8 2015-10-21
154
131
 
155
132
  * Added Cancel method for Pickups (thanks Ramie Blatt!)
156
133
 
157
-
158
134
  ## 2.1.7 2015-10-05
159
135
 
160
136
  * Fixed Address.create_and_verify and changed how errors are raised (thanks Dimitri Roche!)
161
137
  * Require newer version of the multi_json package
162
138
 
163
-
164
139
  ## 2.1.6 2015-06-10
165
140
 
166
141
  * Added Address message accessor for backwards compatability
167
142
 
168
-
169
143
  ## 2.1.5 2015-06-10
170
144
 
171
145
  * Removed Address.message
172
146
 
173
-
174
147
  ## 2.1.4 2015-06-03
175
148
 
176
149
  * Add Printer and PrintJob resources.
177
150
 
178
-
179
151
  ## 2.1.3 2015-04-30
180
152
 
181
153
  * Bux fix, EasyPost::Errors no longer break with a nil json body.
182
154
 
183
-
184
155
  ## 2.1.2 2015-04-29
185
156
 
186
157
  * EasyPost::Errors now correctly parse field errors and error codes.
187
158
 
188
-
189
159
  ## 2.1.1 2015-04-15
190
160
 
191
161
  * CarrierAccount will now correctly save in-place modifications to credentials
192
162
  * Nested variables should now be saved correctly across all models
193
163
  * Fixed version numbering confusion (the previous version was 2.0.15, not 2.1.0)
194
164
 
195
-
196
165
  ## 2.0.15 2015-04-15
197
166
 
198
167
  * Added tracker to shipment buy response
199
168
  * Updated tracker tests
200
169
 
201
-
202
170
  ## 2.0.14 2015-04-15
203
171
 
204
172
  * Added User and CarrierAccount models with CRUD functionality
205
173
 
206
-
207
174
  ## 2.0.13 2014-10-30
208
175
 
209
176
  * Added Pickup, PickupRate resources.
210
177
  * Added ability to pass api_key to a few resources that were missing it.
211
178
 
212
-
213
179
  ## 2.0.12 2014-07-07
214
180
 
215
181
  * Added Item, Container, and Order resources.
216
182
  * Fixed and added a lot of tests.
217
183
 
218
-
219
184
  ## 2.0.11 2013-12-16
220
185
 
221
186
  * Added Event.receive method for parsing events sent by webhook.
222
187
  * Fixed tests to account for the tracking code returning and array of details instead of a Hash
223
188
 
224
-
225
189
  ## 2.0.10 2013-10-03
226
190
 
227
191
  * API Addition: Event resource added for webhook consumption.
228
192
 
229
-
230
193
  ## 2.0.9 2013-09-19
231
194
 
232
195
  * Interface Change: Changed batch.scan_form to batch.create_scan_form to support the ability to refer to scan forms associated to batches.
233
196
 
234
-
235
197
  ## 2.0.3 2013-07-31
236
198
 
237
199
  * API Addition: Tracker resource added. Trackers can be used to register any tracking code with EasyPost webhooks.
238
200
 
239
-
240
201
  ## 2.0.2 2013-07-23
241
202
 
242
203
  * API Addition: Shipment.track_with_code returns tracking details for any tracking code.
243
204
 
244
-
245
205
  ## 2.0.1 2013-07-07
246
206
 
247
207
  * API Addition: Address.create_and_verify returns a verified address in one step.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.0
1
+ 3.5.1
data/lib/easypost/util.rb CHANGED
@@ -1,4 +1,27 @@
1
1
  module EasyPost::Util
2
+ attr_accessor :os_name, :os_version, :os_arch
3
+
4
+ def self.os_name
5
+ case RUBY_PLATFORM
6
+ when /linux/i
7
+ 'Linux'
8
+ when /darwin/i
9
+ 'Darwin'
10
+ when /cygwin|mswin|mingw|bccwin|wince|emx/i
11
+ 'Windows'
12
+ else
13
+ 'Unknown'
14
+ end
15
+ end
16
+
17
+ def self.os_version
18
+ Gem::Platform.local.version
19
+ end
20
+
21
+ def self.os_arch
22
+ Gem::Platform.local.cpu
23
+ end
24
+
2
25
  def self.objects_to_ids(obj)
3
26
  case obj
4
27
  when EasyPost::Resource
data/lib/easypost.rb CHANGED
@@ -36,6 +36,8 @@ require "easypost/tracker"
36
36
  require "easypost/user"
37
37
  require "easypost/webhook"
38
38
 
39
+ require 'easypost/util'
40
+
39
41
  module EasyPost
40
42
  @api_key = nil
41
43
  @api_base = "https://api.easypost.com"
@@ -125,7 +127,9 @@ module EasyPost
125
127
  end
126
128
 
127
129
  request["Content-Type"] = "application/json"
128
- request["User-Agent"] = "EasyPost/v2 RubyClient/#{VERSION} Ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
130
+ request["User-Agent"] = "EasyPost/v2 RubyClient/#{EasyPost::VERSION} Ruby/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} " \
131
+ "OS/#{EasyPost::Util.os_name} OSVersion/#{EasyPost::Util.os_version} " \
132
+ "OSArch/#{EasyPost::Util.os_arch}"
129
133
  if api_key = api_key || @api_key
130
134
  request["Authorization"] = "Basic #{Base64.strict_encode64("#{api_key}:")}"
131
135
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easypost
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Epstein
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-12-06 00:00:00.000000000 Z
13
+ date: 2022-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubygems_version: 3.0.3.1
153
+ rubygems_version: 3.3.11
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: EasyPost Ruby Client Library