easypost 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.0.2 2013-07-23
2
+
3
+ * API Addition: Shipment.track_with_code returns tracking details for any tracking code.
4
+
5
+
1
6
  === 2.0.1 2013-07-07
2
7
 
3
8
  * API Addition: Address.create_and_verify returns a verified address in one step.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
data/easypost.gemspec CHANGED
@@ -6,12 +6,12 @@ require 'easypost/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'easypost'
8
8
  spec.version = EasyPost::VERSION
9
- spec.date = '2013-07-07'
9
+ spec.date = '2013-07-23'
10
10
  spec.summary = 'EasyPost Ruby Client Library'
11
11
  spec.description = 'Client library for accessing the EasyPost shipping API via Ruby.'
12
12
  spec.authors = ['Jon Calhoun', 'Sawyer Bateman']
13
13
  spec.email = 'contact@easypost.com'
14
- spec.homepage = 'https://easypost.com/docs'
14
+ spec.homepage = 'https://www.easypost.com/docs'
15
15
 
16
16
  spec.files = `git ls-files`.split("\n")
17
17
  spec.test_files = `git ls-files -- test/*`.split("\n")
@@ -1,6 +1,12 @@
1
1
  module EasyPost
2
2
  class Shipment < Resource
3
3
 
4
+ def self.track_with_code(params={})
5
+ response, api_key = EasyPost.request(:get, url + '/track', @api_key, params)
6
+
7
+ return response
8
+ end
9
+
4
10
  def get_rates(params={})
5
11
  response, api_key = EasyPost.request(:get, url + '/rates', @api_key, params)
6
12
  self.refresh_from(response, @api_key, true)
@@ -1,3 +1,3 @@
1
1
  module EasyPost
2
- VERSION = "2.0.1"
2
+ VERSION = File.open(File.expand_path("../../../VERSION", __FILE__)).read()
3
3
  end
@@ -155,4 +155,17 @@ describe EasyPost::Shipment do
155
155
  end
156
156
  end
157
157
  end
158
+
159
+ describe '#track_with_code' do
160
+ it 'returns tracking information' do
161
+ tracking = EasyPost::Shipment.track_with_code({
162
+ :carrier => 'usps',
163
+ :tracking_code => '9499907123456123456781'
164
+ })
165
+
166
+ expect(tracking).to be_an_instance_of(Hash)
167
+ expect(tracking[:tracking_details].length).to be > 0
168
+ expect(tracking[:status].length).to be > 0
169
+ end
170
+ end
158
171
  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: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-07 00:00:00.000000000 Z
13
+ date: 2013-07-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client
@@ -105,7 +105,7 @@ files:
105
105
  - spec/scan_form_spec.rb
106
106
  - spec/shipment_spec.rb
107
107
  - spec/spec_helper.rb
108
- homepage: https://easypost.com/docs
108
+ homepage: https://www.easypost.com/docs
109
109
  licenses: []
110
110
  post_install_message:
111
111
  rdoc_options: []