govdelivery-tms 0.8.10 → 0.8.11
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 +4 -4
- data/lib/govdelivery/tms/errors.rb +7 -2
- data/lib/govdelivery/tms/version.rb +1 -1
- data/spec/errors_spec.rb +3 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99f2be27943fbf06fd2170b7e2ccb482edcc866f
|
|
4
|
+
data.tar.gz: a998982dd683514ac32156b12d47166c6734ff2e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c71303041a24185888c8207dd3eb1969e556551916e0459123a56f1d349779a9a230e17d578b3f2001bca281722159f0a6ff6004c7859ccf491b73bebc515e4
|
|
7
|
+
data.tar.gz: d4e5a483b0aeebdf9b05901d3fa2f56e79eca35a3c5789488398bb6d47f156210da26dac5bfe8acb7d5ade2a14a8823b37a85b9f2e9866bc69b8498058fbaf54
|
|
@@ -12,7 +12,8 @@ module GovDelivery::TMS
|
|
|
12
12
|
|
|
13
13
|
# Raised when a recipient list is still being constructed and a request is made to view the
|
|
14
14
|
# recipient list for a message.
|
|
15
|
-
class InProgress < StandardError;
|
|
15
|
+
class InProgress < StandardError;
|
|
16
|
+
end
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
module Errors
|
|
@@ -36,11 +37,15 @@ module GovDelivery::TMS
|
|
|
36
37
|
def initialize(record_or_string)
|
|
37
38
|
if record_or_string.respond_to?(:href)
|
|
38
39
|
@record = record_or_string
|
|
39
|
-
super("Couldn't POST #{record.class} to #{record.href}: #{
|
|
40
|
+
super("Couldn't POST #{record.class} to #{record.href}: #{error_message}")
|
|
40
41
|
else
|
|
41
42
|
super(record_or_string)
|
|
42
43
|
end
|
|
43
44
|
end
|
|
45
|
+
|
|
46
|
+
def error_message
|
|
47
|
+
record.errors.map { |k, v| "#{k} #{v.join(' and ')}" }.join(', ')
|
|
48
|
+
end
|
|
44
49
|
end
|
|
45
50
|
class InvalidPost < InvalidVerb
|
|
46
51
|
end
|
data/spec/errors_spec.rb
CHANGED
|
@@ -3,11 +3,13 @@ require 'spec_helper'
|
|
|
3
3
|
describe GovDelivery::TMS::Errors do
|
|
4
4
|
context 'an errors hash' do
|
|
5
5
|
let(:object_with_errors) do
|
|
6
|
-
double('instance', href: 'href', errors: {
|
|
6
|
+
double('instance', href: 'href', errors: {'body' => ["can't be blank"], 'subject' => ["can't be blank"]})
|
|
7
7
|
end
|
|
8
8
|
subject { GovDelivery::TMS::Errors::InvalidVerb.new(object_with_errors) }
|
|
9
9
|
it 'should work' do
|
|
10
|
+
expect(subject.message).to match(/Couldn't POST/)
|
|
10
11
|
expect(subject.message).to match(/body can't be blank, subject can't be blank/)
|
|
12
|
+
expect(subject.error_message).to match(/body can't be blank, subject can't be blank/)
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govdelivery-tms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GovDelivery
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -74,6 +74,7 @@ files:
|
|
|
74
74
|
- lib/govdelivery/tms/instance_resource.rb
|
|
75
75
|
- lib/govdelivery/tms/link_header.rb
|
|
76
76
|
- lib/govdelivery/tms/logger.rb
|
|
77
|
+
- lib/govdelivery/tms/version.rb
|
|
77
78
|
- lib/govdelivery/tms/mail/delivery_method.rb
|
|
78
79
|
- lib/govdelivery/tms/resource/collections.rb
|
|
79
80
|
- lib/govdelivery/tms/resource/command.rb
|
|
@@ -92,7 +93,6 @@ files:
|
|
|
92
93
|
- lib/govdelivery/tms/resource/webhook.rb
|
|
93
94
|
- lib/govdelivery/tms/util/core_ext.rb
|
|
94
95
|
- lib/govdelivery/tms/util/hal_link_parser.rb
|
|
95
|
-
- lib/govdelivery/tms/version.rb
|
|
96
96
|
- spec/client_spec.rb
|
|
97
97
|
- spec/command_types_spec.rb
|
|
98
98
|
- spec/email_message_spec.rb
|
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
127
|
version: '0'
|
|
128
128
|
requirements: []
|
|
129
129
|
rubyforge_project:
|
|
130
|
-
rubygems_version: 2.
|
|
130
|
+
rubygems_version: 2.1.9
|
|
131
131
|
signing_key:
|
|
132
132
|
specification_version: 4
|
|
133
133
|
summary: A ruby client to interact with the GovDelivery TMS REST API.
|