lob 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f01880ce06eb67d59786cc40db2bf0aa0e0af4c
4
- data.tar.gz: 0812fc81d12a70db6a2f74984dd52df3021dee02
3
+ metadata.gz: 865e83ff8c1948e5999f3c85f9397260306e5142
4
+ data.tar.gz: ef741f0b597b48e6aa074f8f2471d2be9809eef7
5
5
  SHA512:
6
- metadata.gz: a932ae52a9915c3d20c22c6ce27b8e87b618afff584c9dadf974d9b82bb90eb2a58a89b0251390e92810466c773805a8744bb2a2e17c252294e77cc42207a95b
7
- data.tar.gz: 26ccd84ac9924f6e9bfc397b3290561bdfeb67ecf8d243ad0ef8930b5235a24a0b56bcdc30d1f96ecee4d8b4ce092607748f7abfaea487973bec94b7c562e159
6
+ metadata.gz: caf0310352db0c2055546b47eeedd67008e54e9f009afafde599c4dfe4892d87e44370eedc30e42cc9a78d46b05190c11e2aba891be7c5db5d243f29b3a67a5c
7
+ data.tar.gz: 416e556d6f7fd7267668825bfdc9ea410cc907161ec74ced9616bd0de4ce50fc621264fc7de5aac218d777bc2684fe295216ea8aa81c745d0357f3ee451d9c9b
@@ -1,3 +1,9 @@
1
+ ## [**2.1.0**](https://github.com/lob/lob-ruby/releases/tag/v2.1.0)
2
+ - [**#119**] (https://github.com/lob/lob-ruby/pull/119) better error messages
3
+
4
+ ## [**2.0.1**](https://github.com/lob/lob-ruby/releases/tag/v2.0.1)
5
+ - [**#118**] (https://github.com/lob/lob-ruby/pull/118) removed prawn and fixed examples
6
+
1
7
  ## 2.0.0
2
8
 
3
9
  Version 2.0.0 introduces several breaking changes. It requires a minimum API version of `2015-04-11`.
data/lib/lob.rb CHANGED
@@ -52,7 +52,7 @@ module Lob
52
52
  message = response.fetch("error").fetch("message")
53
53
  raise InvalidRequestError.new(message, error.http_code, error.http_body, error.response)
54
54
  rescue JSON::ParserError, KeyError
55
- raise LobError.new("Invalid response object: #{}", error.http_code, error.http_body)
55
+ raise LobError.new("Invalid response object:", error.http_code, error.http_body)
56
56
  end
57
57
  end
58
58
 
@@ -1,17 +1,13 @@
1
1
  module Lob
2
2
  class LobError < StandardError
3
- attr_reader :message, :http_status, :http_body, :json_body
3
+ attr_reader :http_status, :http_body, :json_body
4
4
 
5
- def initialize(message=nil, http_status=nil, http_body=nil, json_body=nil)
6
- @message = message
5
+ def initialize(message, http_status=nil, http_body=nil, json_body=nil)
7
6
  @http_status = http_status
8
7
  @http_body = http_body
9
8
  @json_body = json_body
10
- end
11
-
12
- def to_s
13
9
  status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
14
- "#{status_string}#{@message}"
10
+ super("#{status_string}#{message} \n #{@http_body}")
15
11
  end
16
12
  end
17
13
  end
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "2.0.1"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -5,12 +5,14 @@ describe Lob::LobError do
5
5
  describe "#to_s" do
6
6
  it "should return a string with the status code and message" do
7
7
  error = Lob::LobError.new("hello", 404)
8
- error.to_s.must_equal("(Status 404) hello")
8
+ error.to_s.must_include("(Status 404)")
9
+ error.to_s.must_include("hello")
9
10
  end
10
11
 
11
12
  it "should returna a message without the status code if not provided" do
12
13
  error = Lob::LobError.new("hello")
13
- error.to_s.must_equal("hello")
14
+ error.to_s.wont_include("Status")
15
+ error.to_s.must_include("hello")
14
16
  end
15
17
  end
16
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lob
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client