easypost 2.1.10 → 2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -1
- data/VERSION +1 -1
- data/lib/easypost.rb +4 -2
- data/lib/easypost/user.rb +7 -0
- data/spec/spec_helper.rb +0 -1
- data/spec/user_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a3a13e746d0851d4cb46f56364bb3f769886cc5
|
4
|
+
data.tar.gz: fa679d039ad77f52bb824ef8c46fc437edb05b6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d4a210542383e8c9c38b9a9bdb26d63d5c2c3b9716be4d2d59f92dd183c0a7abf56e9acf82027e353b1ad3d0fa3a0c222b9121cfd6fcc154df1c704b26b8508
|
7
|
+
data.tar.gz: c5577db5003a094d9489a15b314f49b878478cb031ddfc2fa93b1870cdc024a6e47a265a26ca954af353d72db9577cd0d2ad146575f902fcd07fead5c337c479
|
data/CHANGELOG
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
=== 2.1.11 2016-02-04
|
2
|
+
|
3
|
+
* Allowed user creation for top-level users
|
4
|
+
|
5
|
+
|
1
6
|
=== 2.1.10 2015-12-23
|
2
7
|
|
3
8
|
* Added verify and verify_strict params to Address.create
|
4
|
-
* Added Tracker.create_list and Tracker.all_updated for working with large
|
9
|
+
* Added Tracker.create_list and Tracker.all_updated for working with large
|
5
10
|
numbers of Trackers.
|
6
11
|
|
7
12
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.11
|
data/lib/easypost.rb
CHANGED
@@ -81,9 +81,11 @@ module EasyPost
|
|
81
81
|
self.http_config.merge!(http_config_params)
|
82
82
|
end
|
83
83
|
|
84
|
-
def self.request(method, url, api_key, params={}, headers={})
|
84
|
+
def self.request(method, url, api_key, params={}, headers={}, api_key_required=true)
|
85
85
|
api_key ||= @@api_key
|
86
|
-
|
86
|
+
if api_key_required
|
87
|
+
raise Error.new('No API key provided.') unless api_key
|
88
|
+
end
|
87
89
|
|
88
90
|
params = Util.objects_to_ids(params)
|
89
91
|
url = self.api_url(url)
|
data/lib/easypost/user.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
module EasyPost
|
2
2
|
class User < Resource
|
3
|
+
def self.create(params={}, api_key=nil)
|
4
|
+
wrapped_params = {}
|
5
|
+
wrapped_params[self.class_name().to_sym] = params
|
6
|
+
response, api_key = EasyPost.request(:post, self.url, api_key, wrapped_params, {}, false)
|
7
|
+
return Util.convert_to_easypost_object(response, api_key)
|
8
|
+
end
|
9
|
+
|
3
10
|
def save
|
4
11
|
if @unsaved_values.length > 0
|
5
12
|
values = {}
|
data/spec/spec_helper.rb
CHANGED
data/spec/user_spec.rb
CHANGED
@@ -5,6 +5,22 @@ describe EasyPost::User do
|
|
5
5
|
EasyPost.api_key = "PRODUCTION API KEY"
|
6
6
|
end
|
7
7
|
|
8
|
+
# This test requires APIKEY to be nil
|
9
|
+
# it 'creates a new user' do
|
10
|
+
# EasyPost.api_key = nil
|
11
|
+
|
12
|
+
# user = EasyPost::User.create({
|
13
|
+
# name: "Chad Vader",
|
14
|
+
# email: 'c.vader3@example.com',
|
15
|
+
# password: "4theempire",
|
16
|
+
# password_confirmation: "4theempire",
|
17
|
+
# phone_number: '555-123-4321'
|
18
|
+
# })
|
19
|
+
|
20
|
+
# expect(user.id).not_to be_nil
|
21
|
+
# end
|
22
|
+
|
23
|
+
|
8
24
|
# Uncomment these tests to test CRUD operations on the User model
|
9
25
|
# Note: You must provide a Production Api Key in order to run these tests
|
10
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easypost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sawyer Bateman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|