govdelivery-tms 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile +14 -0
- data/README.md +324 -0
- data/Rakefile +20 -0
- data/govdelivery-tms.gemspec +30 -0
- data/lib/govdelivery-tms.rb +43 -0
- data/lib/govdelivery-tms/base.rb +37 -0
- data/lib/govdelivery-tms/client.rb +97 -0
- data/lib/govdelivery-tms/collection_resource.rb +54 -0
- data/lib/govdelivery-tms/connection.rb +34 -0
- data/lib/govdelivery-tms/errors.rb +58 -0
- data/lib/govdelivery-tms/instance_resource.rb +219 -0
- data/lib/govdelivery-tms/link_header.rb +223 -0
- data/lib/govdelivery-tms/logger.rb +36 -0
- data/lib/govdelivery-tms/mail/delivery_method.rb +63 -0
- data/lib/govdelivery-tms/resource/collections.rb +98 -0
- data/lib/govdelivery-tms/resource/command.rb +25 -0
- data/lib/govdelivery-tms/resource/command_action.rb +17 -0
- data/lib/govdelivery-tms/resource/command_type.rb +20 -0
- data/lib/govdelivery-tms/resource/email_message.rb +81 -0
- data/lib/govdelivery-tms/resource/email_recipient.rb +31 -0
- data/lib/govdelivery-tms/resource/email_recipient_click.rb +8 -0
- data/lib/govdelivery-tms/resource/email_recipient_open.rb +8 -0
- data/lib/govdelivery-tms/resource/email_template.rb +15 -0
- data/lib/govdelivery-tms/resource/from_address.rb +10 -0
- data/lib/govdelivery-tms/resource/inbound_sms_message.rb +8 -0
- data/lib/govdelivery-tms/resource/ipaws_acknowledgement.rb +9 -0
- data/lib/govdelivery-tms/resource/ipaws_alert.rb +38 -0
- data/lib/govdelivery-tms/resource/ipaws_category.rb +7 -0
- data/lib/govdelivery-tms/resource/ipaws_cog_profile.rb +29 -0
- data/lib/govdelivery-tms/resource/ipaws_event_code.rb +7 -0
- data/lib/govdelivery-tms/resource/ipaws_nwem_area.rb +18 -0
- data/lib/govdelivery-tms/resource/ipaws_nwem_authorization.rb +9 -0
- data/lib/govdelivery-tms/resource/ipaws_nwem_auxilary_data.rb +8 -0
- data/lib/govdelivery-tms/resource/ipaws_response_type.rb +7 -0
- data/lib/govdelivery-tms/resource/ipaws_static_resource.rb +8 -0
- data/lib/govdelivery-tms/resource/keyword.rb +30 -0
- data/lib/govdelivery-tms/resource/recipient.rb +10 -0
- data/lib/govdelivery-tms/resource/sms_message.rb +35 -0
- data/lib/govdelivery-tms/resource/webhook.rb +20 -0
- data/lib/govdelivery-tms/util/core_ext.rb +27 -0
- data/lib/govdelivery-tms/util/hal_link_parser.rb +50 -0
- data/lib/govdelivery-tms/version.rb +3 -0
- data/spec/client_spec.rb +41 -0
- data/spec/command_types_spec.rb +29 -0
- data/spec/email_message_spec.rb +102 -0
- data/spec/email_template_spec.rb +149 -0
- data/spec/errors_spec.rb +13 -0
- data/spec/from_address_spec.rb +86 -0
- data/spec/inbound_sms_messages_spec.rb +19 -0
- data/spec/instance_resource_spec.rb +61 -0
- data/spec/ipaws_acknowledgement_spec.rb +16 -0
- data/spec/ipaws_alerts_spec.rb +192 -0
- data/spec/ipaws_cog_profile_spec.rb +75 -0
- data/spec/ipaws_event_codes_spec.rb +35 -0
- data/spec/ipaws_nwem_areas_spec.rb +58 -0
- data/spec/ipaws_nwem_authorization_spec.rb +16 -0
- data/spec/keyword_spec.rb +62 -0
- data/spec/keywords_spec.rb +21 -0
- data/spec/mail/delivery_method_spec.rb +52 -0
- data/spec/sms_message_spec.rb +63 -0
- data/spec/sms_messages_spec.rb +21 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/tms_spec.rb +7 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZWUwNjNlYmFmOTc5Y2I4ODIwYmZhNTVkOWU0MGUzMzJjOTZiYzA1ZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NWNmYzNlYjRlOWI4NjVmYmUzOTQzNzBkMDViNTExNTIwZWNhNDRiMw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjJiNTAxMGVhZGY4ZTY0M2JmNGIwNzkwZDY1NWMxYzA2NDBiYzI4ZGE4MjBh
|
10
|
+
Njg5OTUyODgzNDJmMzE2MTUxNWNmNjM5Y2M3MjBmYTQ0MmJhMzA1M2Q2MmQ5
|
11
|
+
MzNhZmY5MTU5YTRhM2MwM2FkYzVlYTVlYmMzZjVlNmM5ZmE2MWY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTAzZDMxMDdkMjI2NDBjNDQxYzk1NzA2YzA5ZmJiYjI3YTQ1YWJmMzJjMGVj
|
14
|
+
NjI4ZjExMmQzYzg5MTNiODE2YTVmMGNhYTZkYmU2NzE4ZWQ1NWFjMDU0YjRi
|
15
|
+
NzkxZDMyMzM4ZDI2YmU4NzE2OTE5YzY4NmFlN2VjOTA5ZmM1Yjc=
|
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
gemspec
|
3
|
+
|
4
|
+
group :development, :test do
|
5
|
+
gem "appraisal"
|
6
|
+
gem 'rspec', '~> 2.99'
|
7
|
+
gem 'rspec-its'
|
8
|
+
gem 'rake'
|
9
|
+
gem 'redcarpet', :platform => :ruby
|
10
|
+
gem 'yard'
|
11
|
+
gem 'mail'
|
12
|
+
gem 'rubygems-tasks', :git => 'https://github.com/postmodern/rubygems-tasks.git', :platform => :ruby
|
13
|
+
end
|
14
|
+
|
data/README.md
ADDED
@@ -0,0 +1,324 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/govdelivery/govdelivery-tms-ruby.svg?branch=master)](https://travis-ci.org/govdelivery/govdelivery-tms-ruby)
|
2
|
+
|
3
|
+
TMS Client
|
4
|
+
===========
|
5
|
+
This is a reference Ruby client to interact with the GovDelivery TMS REST API.
|
6
|
+
|
7
|
+
Installation
|
8
|
+
------------
|
9
|
+
### Using Bundler
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'govdelivery-tms'
|
13
|
+
```
|
14
|
+
|
15
|
+
### Standalone
|
16
|
+
|
17
|
+
```
|
18
|
+
$ gem install govdelivery-tms
|
19
|
+
```
|
20
|
+
|
21
|
+
|
22
|
+
Connecting
|
23
|
+
----------
|
24
|
+
Loading an instance of `TMS::Client` will automatically connect to the API to query the available resources for your account.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
# default api root endpoint is https://tms.govdelivery.com
|
28
|
+
client = TMS::Client.new('auth_token', :api_root => 'https://stage-tms.govdelivery.com')
|
29
|
+
```
|
30
|
+
|
31
|
+
Messages
|
32
|
+
--------
|
33
|
+
|
34
|
+
### Loading messages
|
35
|
+
Sms and Email messages can be retrieved with the `get` collection method. Messages are paged in groups of 50. To retrieve another page, used the `next` method. This method will not be defined if another page is not available.
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
client.sms_messages.get # get the first page of sms messages
|
39
|
+
client.sms_messages.next.get # get the next page of sms messages
|
40
|
+
```
|
41
|
+
|
42
|
+
|
43
|
+
### Sending an SMS Message
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
message = client.sms_messages.build(:body=>'Test Message!')
|
47
|
+
message.recipients.build(:phone=>'5551112222')
|
48
|
+
message.recipients.build(:phone=>'5551112223')
|
49
|
+
message.recipients.build # invalid - no phone
|
50
|
+
message.post # true
|
51
|
+
message.recipients.collection.detect{|r| r.errors } # {"phone"=>["is not a number"]}
|
52
|
+
# save succeeded, but we have one bad recipient
|
53
|
+
message.href # "/messages/sms/87"
|
54
|
+
message.get # <TMS::SmsMessage href=/messages/sms/87 attributes={...}>
|
55
|
+
```
|
56
|
+
|
57
|
+
### Retrieving Inbound SMS Messages
|
58
|
+
```ruby
|
59
|
+
client.inbound_sms_messages.get # <TMS::InboundSmsMessages href=/inbound/sms attributes={...}>
|
60
|
+
inbound_sms = client.inbound_sms_messages.collection.first # <TMS::InboundSmsMessage href=/inbound/sms/10041 attributes={...}>
|
61
|
+
inbound_sms.to # "+15559999999"
|
62
|
+
inbound_sms.from # "+15005550006"
|
63
|
+
inbound_sms.attributes # {:from=>"+15005550006", :to=>"+15559999999", :body=>"test", :command_status=>"success", :keyword_response=>"kwidjebo", :created_at=>"2014-11-05T17:15:01Z"}
|
64
|
+
|
65
|
+
```
|
66
|
+
|
67
|
+
### Sending an Email Message
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
message = client.email_messages.build(:body=>'<p><a href="http://example.com">Visit here</a>',
|
71
|
+
:subject => 'Hey',
|
72
|
+
:from_email => 'foo@example.com')
|
73
|
+
message.recipients.build(:email=>'example1@example.com')
|
74
|
+
message.recipients.build(:email=>'')
|
75
|
+
message.post # true
|
76
|
+
message.recipients.collection.detect{|r| r.errors } # {"email"=>["can't be blank"]}
|
77
|
+
# save succeeded, but we have one bad recipient
|
78
|
+
message.href # "/messages/email/87"
|
79
|
+
message.get # <TMS::EmailMessage href=/messages/email/88 attributes={...}>
|
80
|
+
```
|
81
|
+
|
82
|
+
#### Sending an Email with Macros
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
message = client.email_messages.build(:subject=>'Hello!',
|
86
|
+
:body=>'<p>Hi <span style="color:red;">[[name]]</span>!</p>',
|
87
|
+
:macros=>{"name"=>"there"})
|
88
|
+
message.recipients.build(:email=>'jim@example.com', :macros=>{"name"=>"Jim"})
|
89
|
+
message.recipients.build(:email=>'amy@example.com', :macros=>{"name"=>"Amy"})
|
90
|
+
message.recipients.build(:email=>'bill@example.com')
|
91
|
+
message.post
|
92
|
+
```
|
93
|
+
|
94
|
+
### Obtaining IPAWS Ack ###
|
95
|
+
```ruby
|
96
|
+
client.ipaws_acknowledgement.get
|
97
|
+
client.ipaws_acknowledgement.ACK # "PONG"
|
98
|
+
```
|
99
|
+
|
100
|
+
### Obtaining IPAWS COG Profile
|
101
|
+
```ruby
|
102
|
+
client.ipaws_cog_profile.get
|
103
|
+
client.ipaws_cog_profile.attributes # {:cogid=>"120082", :name=>"GovDelivery" ... }
|
104
|
+
```
|
105
|
+
|
106
|
+
### Determining NWEM COG Authorization ###
|
107
|
+
```ruby
|
108
|
+
client.ipaws_nwem_authorization.get
|
109
|
+
client.ipaws_nwem_authorization.cogid # true
|
110
|
+
```
|
111
|
+
|
112
|
+
### Obtaining NWEM Auxilary Data (Authorized areas) ###
|
113
|
+
```ruby
|
114
|
+
client.ipaws_nwem_areas.get
|
115
|
+
client.ipaws_nwem_areas.collection.first.countyFipsCd # "51013"
|
116
|
+
```
|
117
|
+
|
118
|
+
### Sending an IPAWS Alert ###
|
119
|
+
```ruby
|
120
|
+
alert = client.ipaws_alerts.build({ identifier: "CAP12-TEST-12345", sender: 'test@open.com' ...})
|
121
|
+
alert.post # true
|
122
|
+
alert.ipaws_response # { "identifier"=>"CAP12-TEST-1397743203", "statuses"=> [{"CHANNELNAME"=>"CAPEXCH" ... }]}
|
123
|
+
```
|
124
|
+
|
125
|
+
|
126
|
+
Webhooks
|
127
|
+
-------
|
128
|
+
### POST to a URL when a recipient is blacklisted (i.e. to remove from your list)
|
129
|
+
|
130
|
+
|
131
|
+
```ruby
|
132
|
+
webhook = client.webhooks.build(:url=>'http://your.url', :event_type=>'blacklisted')
|
133
|
+
webhook.post # true
|
134
|
+
```
|
135
|
+
|
136
|
+
POSTs will include in the body the following attributes:
|
137
|
+
|
138
|
+
attribute | description
|
139
|
+
------------- | -------------
|
140
|
+
message_type | 'sms' or 'email'
|
141
|
+
status: | message state
|
142
|
+
recipient_url | recipient URL
|
143
|
+
messsage_url | message URL
|
144
|
+
error_message | (failures only)
|
145
|
+
completed_at | (sent or failed recipients only)
|
146
|
+
|
147
|
+
|
148
|
+
Metrics
|
149
|
+
-------
|
150
|
+
### Viewing recipients that clicked on a link in an email
|
151
|
+
|
152
|
+
```ruby
|
153
|
+
email_message.get
|
154
|
+
email_message.clicked.get
|
155
|
+
email_message.clicked.collection # => [<#EmailRecipient>,...]
|
156
|
+
```
|
157
|
+
|
158
|
+
### Viewing recipients that opened an email
|
159
|
+
|
160
|
+
```ruby
|
161
|
+
email_message.get
|
162
|
+
email_message.opened.get
|
163
|
+
email_message.opened.collection # => [<#EmailRecipient>,...]
|
164
|
+
```
|
165
|
+
|
166
|
+
### Viewing a list of statistics for a recipient
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
email_recipient.clicks.get.collection #=> [<#EmailRecipientClick>,...]
|
170
|
+
|
171
|
+
email_recipient.opens.get.collection #=> [<#EmailRecipientOpen>,...]
|
172
|
+
```
|
173
|
+
|
174
|
+
Configuring 2-way SMS
|
175
|
+
---------------------
|
176
|
+
|
177
|
+
### Listing Command Types
|
178
|
+
Command Types are the available commands that can be used to respond to an incoming SMS message.
|
179
|
+
|
180
|
+
```ruby
|
181
|
+
command_types = client.command_types.get
|
182
|
+
command_types.collection.each do |at|
|
183
|
+
puts at.name # "forward"
|
184
|
+
puts at.string_fields # ["url", ...]
|
185
|
+
puts at.array_fields # ["foo", ...]
|
186
|
+
end
|
187
|
+
```
|
188
|
+
|
189
|
+
### Managing Keywords
|
190
|
+
Keywords are chunks of text that are used to match an incoming SMS message.
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
# CRUD
|
194
|
+
keyword = client.keywords.build(:name => "BUSRIDE", :response_text => "Visit example.com/rides for more info")
|
195
|
+
keyword.post # true
|
196
|
+
keyword.name # 'busride'
|
197
|
+
keyword.name = "TRAINRIDE"
|
198
|
+
keyword.put # true
|
199
|
+
keyword.name # 'trainride'
|
200
|
+
keyword.delete # true
|
201
|
+
|
202
|
+
# list
|
203
|
+
keywords = client.keywords.get
|
204
|
+
keywords.collection.each do |k|
|
205
|
+
puts k.name, k.response_text
|
206
|
+
end
|
207
|
+
```
|
208
|
+
|
209
|
+
### Managing Commands
|
210
|
+
Commands have a command type and one or more keywords. The example below configures the system to respond to an incoming SMS message containing the string "RIDE" (or "ride") by forwarding an http POST to `http://example.com/new_url`. The POST body variables are documented in GovDelivery's [TMS REST API documentation](https://govdelivery.atlassian.net/wiki/display/PM/TMS+Customer+API+Documentation#TMSCustomerAPIDocumentation-Configuring2-waySMS "GovDelivery TMS REST API").
|
211
|
+
|
212
|
+
```ruby
|
213
|
+
# CRUD
|
214
|
+
keyword = client.keywords.build(:name => "RIDE")
|
215
|
+
keyword.post
|
216
|
+
command = keyword.commands.build(
|
217
|
+
:name => "Forward to somewhere else",
|
218
|
+
:params => {:url => "http://example.com", :http_method => "get"},
|
219
|
+
:command_type => :forward)
|
220
|
+
command.post
|
221
|
+
command.params = {:url => "http://example.com/new_url", :http_method => "post"}
|
222
|
+
command.put
|
223
|
+
command.delete
|
224
|
+
|
225
|
+
# list
|
226
|
+
commands = keyword.commands.get
|
227
|
+
commands.collection.each do |c|
|
228
|
+
puts c.inspect
|
229
|
+
end
|
230
|
+
```
|
231
|
+
|
232
|
+
### Viewing Command Actions
|
233
|
+
Each time a given command is executed, a command action is created.
|
234
|
+
|
235
|
+
**Note** The actions relationship does not exist on commands that have 0 command actions. Because of this, an attempt to access the command_actions attribute of a
|
236
|
+
command that has 0 command actions will result in a NoMethodError.
|
237
|
+
|
238
|
+
```ruby
|
239
|
+
# Using the command from above
|
240
|
+
begin
|
241
|
+
command.get
|
242
|
+
command_actions = command.command_actions
|
243
|
+
command_actions.get
|
244
|
+
command_action = command_actions.collection.first
|
245
|
+
command_action.inbound_sms_message # InboundSmsMessage object that initiated this command execution
|
246
|
+
command_action.response_body # String returned by the forwarded to URL
|
247
|
+
command_action.status # HTTP Status returned by the forwarded to URL
|
248
|
+
command_action.content_type # Content-Type header returned by the forwarded to URL
|
249
|
+
rescue NoMethodError => e
|
250
|
+
# No command actions to view
|
251
|
+
end
|
252
|
+
```
|
253
|
+
|
254
|
+
Logging
|
255
|
+
-------
|
256
|
+
|
257
|
+
Any instance of a [Logger](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html "Ruby Logger")-like class can be passed in to the client; incoming and outgoing request information will then be logged to that instance.
|
258
|
+
|
259
|
+
The example below configures `TMS::Client` to log to `STDOUT`:
|
260
|
+
|
261
|
+
```ruby
|
262
|
+
logger = Logger.new(STDOUT)
|
263
|
+
client = TMS::Client.new('auth_token', :logger => logger)
|
264
|
+
```
|
265
|
+
|
266
|
+
ActionMailer integration
|
267
|
+
------------------------
|
268
|
+
|
269
|
+
You can use TMS from the mail gem or ActionMailer as a delivery method.
|
270
|
+
|
271
|
+
Gemfile
|
272
|
+
```ruby
|
273
|
+
gem 'govdelivery-tms', :require=>'govdelivery-tms/mail/delivery_method'
|
274
|
+
```
|
275
|
+
|
276
|
+
config/environment.rb
|
277
|
+
```ruby
|
278
|
+
config.action_mailer.delivery_method = :govdelivery_tms
|
279
|
+
config.action_mailer.govdelivery_tms_settings = {
|
280
|
+
:auth_token=>'auth_token',
|
281
|
+
:api_root=>'https://stage-tms.govdelivery.com'
|
282
|
+
}
|
283
|
+
```
|
284
|
+
|
285
|
+
|
286
|
+
Generating Documentation
|
287
|
+
------------------------
|
288
|
+
This project uses [yard](https://github.com/lsegal/yard) to generate documentation. To generate API documentation yourself, use the following series of commands from the project root:
|
289
|
+
|
290
|
+
```ruby
|
291
|
+
# install development gems
|
292
|
+
bundle install
|
293
|
+
# generate documentation
|
294
|
+
rake yard
|
295
|
+
```
|
296
|
+
The generated documentation will be placed in the `doc` folder.
|
297
|
+
|
298
|
+
|
299
|
+
Running Tests
|
300
|
+
-------------
|
301
|
+
```ruby
|
302
|
+
appraisal install
|
303
|
+
# optionally specify an activesupport version to test against (2/3/4), e.g.
|
304
|
+
# appraisal 4 rake ## for ruby 2.1.2
|
305
|
+
appraisal rake
|
306
|
+
```
|
307
|
+
|
308
|
+
|
309
|
+
Compatibility
|
310
|
+
-------------
|
311
|
+
This project is tested and compatible with MRI 1.9.3, JRuby 1.7.12, and MRI 2.1.2.
|
312
|
+
|
313
|
+
License
|
314
|
+
-------
|
315
|
+
Copyright (c) 2013, GovDelivery, Inc.
|
316
|
+
|
317
|
+
All rights reserved.
|
318
|
+
|
319
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
320
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
321
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
322
|
+
* Neither the name of GovDelivery nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
323
|
+
|
324
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
unless defined?(JRUBY_VERSION)
|
6
|
+
require 'rubygems/tasks'
|
7
|
+
require 'rubygems/tasks/scm'
|
8
|
+
Gem::Tasks.new
|
9
|
+
end
|
10
|
+
require 'yard'
|
11
|
+
|
12
|
+
YARD::Rake::YardocTask.new do |t|
|
13
|
+
t.files = ['lib/**/*.rb']
|
14
|
+
end
|
15
|
+
|
16
|
+
RSpec::Core::RakeTask.new(:spec)
|
17
|
+
|
18
|
+
|
19
|
+
task :default => :spec
|
20
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "govdelivery-tms/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "govdelivery-tms"
|
7
|
+
s.version = TMS::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["GovDelivery"]
|
10
|
+
s.email = ["support@govdelivery.com"]
|
11
|
+
s.homepage = "http://govdelivery.com"
|
12
|
+
s.summary = %q{A ruby client to interact with the GovDelivery TMS REST API.}
|
13
|
+
s.description = %q{A reference implementation, written in Ruby,
|
14
|
+
to interact with GovDelivery's TMS API. The client is
|
15
|
+
compatible with Ruby 1.9 and 2.0. }
|
16
|
+
|
17
|
+
s.add_runtime_dependency "activesupport"
|
18
|
+
s.add_runtime_dependency "faraday"
|
19
|
+
s.add_runtime_dependency "faraday_middleware"
|
20
|
+
|
21
|
+
s.files = %w{
|
22
|
+
Gemfile
|
23
|
+
README.md
|
24
|
+
Rakefile
|
25
|
+
govdelivery-tms.gemspec
|
26
|
+
} + Dir["lib/**/*"]
|
27
|
+
|
28
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
29
|
+
s.require_paths = ["lib"]
|
30
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module TMS #:nodoc:
|
2
|
+
end
|
3
|
+
|
4
|
+
require 'active_support/core_ext/hash'
|
5
|
+
require 'govdelivery-tms/version'
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday_middleware'
|
8
|
+
|
9
|
+
require 'govdelivery-tms/link_header'
|
10
|
+
require 'govdelivery-tms/util/hal_link_parser'
|
11
|
+
require 'govdelivery-tms/util/core_ext'
|
12
|
+
require 'govdelivery-tms/connection'
|
13
|
+
require 'govdelivery-tms/client'
|
14
|
+
require 'govdelivery-tms/logger'
|
15
|
+
require 'govdelivery-tms/base'
|
16
|
+
require 'govdelivery-tms/instance_resource'
|
17
|
+
require 'govdelivery-tms/collection_resource'
|
18
|
+
require 'govdelivery-tms/errors'
|
19
|
+
|
20
|
+
require 'govdelivery-tms/resource/collections'
|
21
|
+
require 'govdelivery-tms/resource/recipient'
|
22
|
+
require 'govdelivery-tms/resource/email_recipient'
|
23
|
+
require 'govdelivery-tms/resource/email_recipient_open'
|
24
|
+
require 'govdelivery-tms/resource/email_recipient_click'
|
25
|
+
require 'govdelivery-tms/resource/from_address'
|
26
|
+
require 'govdelivery-tms/resource/email_template'
|
27
|
+
require 'govdelivery-tms/resource/sms_message'
|
28
|
+
require 'govdelivery-tms/resource/email_message'
|
29
|
+
require 'govdelivery-tms/resource/inbound_sms_message'
|
30
|
+
require 'govdelivery-tms/resource/command_type'
|
31
|
+
require 'govdelivery-tms/resource/command_action'
|
32
|
+
require 'govdelivery-tms/resource/command'
|
33
|
+
require 'govdelivery-tms/resource/keyword'
|
34
|
+
require 'govdelivery-tms/resource/ipaws_static_resource'
|
35
|
+
require 'govdelivery-tms/resource/ipaws_category'
|
36
|
+
require 'govdelivery-tms/resource/ipaws_event_code'
|
37
|
+
require 'govdelivery-tms/resource/ipaws_response_type'
|
38
|
+
require 'govdelivery-tms/resource/ipaws_acknowledgement'
|
39
|
+
require 'govdelivery-tms/resource/ipaws_cog_profile'
|
40
|
+
require 'govdelivery-tms/resource/ipaws_nwem_authorization'
|
41
|
+
require 'govdelivery-tms/resource/ipaws_nwem_area'
|
42
|
+
require 'govdelivery-tms/resource/ipaws_alert'
|
43
|
+
require 'govdelivery-tms/resource/webhook'
|