xednese 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/README.md +22 -3
  4. data/Rakefile +8 -2
  5. data/bin/xednese +16 -0
  6. data/lib/xednese.rb +36 -9
  7. data/lib/xednese/account.rb +37 -0
  8. data/lib/xednese/account/dispatcher.rb +30 -0
  9. data/lib/xednese/account/messages.rb +47 -0
  10. data/lib/xednese/accounts.rb +14 -6
  11. data/lib/xednese/batch.rb +68 -0
  12. data/lib/xednese/batches.rb +33 -0
  13. data/lib/xednese/client.rb +46 -0
  14. data/lib/xednese/messages.rb +24 -0
  15. data/lib/xednese/requests/account.rb +17 -0
  16. data/lib/xednese/requests/batch.rb +17 -0
  17. data/lib/xednese/requests/messages.rb +1 -1
  18. data/lib/xednese/responses/batch.rb +20 -0
  19. data/lib/xednese/responses/batches.rb +15 -0
  20. data/lib/xednese/responses/status.rb +22 -0
  21. data/lib/xednese/users.rb +3 -8
  22. data/lib/xednese/version.rb +1 -1
  23. data/scenarios/accounts/getting_all_accounts.rb +37 -0
  24. data/scenarios/accounts/getting_an_account.rb +29 -0
  25. data/scenarios/helper.rb +113 -0
  26. data/spec/helper.rb +3 -3
  27. data/spec/xednese/{dispatcher_spec.rb → account/dispatcher_spec.rb} +5 -4
  28. data/spec/xednese/account/messages_spec.rb +56 -0
  29. data/spec/xednese/account_spec.rb +93 -0
  30. data/spec/xednese/accounts_spec.rb +19 -14
  31. data/spec/xednese/batch_spec.rb +121 -0
  32. data/spec/xednese/batches_spec.rb +70 -0
  33. data/spec/xednese/client_spec.rb +76 -2
  34. data/spec/xednese/messages_spec.rb +25 -1
  35. data/spec/xednese/requests/account_spec.rb +20 -0
  36. data/spec/xednese/requests/batch_spec.rb +20 -0
  37. data/spec/xednese/requests/messages_spec.rb +1 -1
  38. data/spec/xednese/responses/account_spec.rb +1 -1
  39. data/spec/xednese/responses/accounts_spec.rb +1 -1
  40. data/spec/xednese/responses/batch_spec.rb +83 -0
  41. data/spec/xednese/responses/batches_spec.rb +95 -0
  42. data/spec/xednese/responses/message_dispatcher_headers_spec.rb +1 -1
  43. data/spec/xednese/responses/message_header_spec.rb +1 -1
  44. data/spec/xednese/responses/message_headers_spec.rb +1 -1
  45. data/spec/xednese/responses/status_spec.rb +55 -0
  46. data/spec/xednese/users_spec.rb +1 -12
  47. data/spec/xednese_spec.rb +52 -12
  48. metadata +58 -8
  49. data/lib/xednese/dispatcher.rb +0 -20
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xednese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Hawxwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-08 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: seq
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.0
33
+ version: 0.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.0
40
+ version: 0.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -94,11 +94,26 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.17'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.17'
97
111
  description: |2
98
112
  Xednese provides an easy to use client for interacting with the Esendex
99
113
  REST API.
100
114
  email: m@hawx.me
101
- executables: []
115
+ executables:
116
+ - xednese
102
117
  extensions: []
103
118
  extra_rdoc_files: []
104
119
  files:
@@ -106,33 +121,55 @@ files:
106
121
  - Gemfile
107
122
  - Rakefile
108
123
  - LICENSE
124
+ - bin/xednese
109
125
  - lib/xednese.rb
110
126
  - lib/xednese/accounts.rb
111
127
  - lib/xednese/client.rb
112
128
  - lib/xednese/messages.rb
113
129
  - lib/xednese/version.rb
130
+ - lib/xednese/batch.rb
131
+ - lib/xednese/account.rb
114
132
  - lib/xednese/users.rb
115
133
  - lib/xednese/responses/accounts.rb
116
134
  - lib/xednese/responses/message_headers.rb
117
135
  - lib/xednese/responses/parser.rb
118
136
  - lib/xednese/responses/message_header.rb
137
+ - lib/xednese/responses/batch.rb
119
138
  - lib/xednese/responses/account.rb
139
+ - lib/xednese/responses/status.rb
140
+ - lib/xednese/responses/batches.rb
120
141
  - lib/xednese/responses/message_dispatcher_headers.rb
121
- - lib/xednese/dispatcher.rb
122
142
  - lib/xednese/requests/messages.rb
143
+ - lib/xednese/requests/batch.rb
144
+ - lib/xednese/requests/account.rb
145
+ - lib/xednese/account/messages.rb
146
+ - lib/xednese/account/dispatcher.rb
147
+ - lib/xednese/batches.rb
148
+ - scenarios/helper.rb
149
+ - scenarios/accounts/getting_all_accounts.rb
150
+ - scenarios/accounts/getting_an_account.rb
123
151
  - spec/helper.rb
124
152
  - spec/xednese_spec.rb
125
153
  - spec/xednese/accounts_spec.rb
154
+ - spec/xednese/account_spec.rb
155
+ - spec/xednese/batch_spec.rb
126
156
  - spec/xednese/responses/message_header_spec.rb
127
157
  - spec/xednese/responses/message_dispatcher_headers_spec.rb
128
158
  - spec/xednese/responses/accounts_spec.rb
129
159
  - spec/xednese/responses/account_spec.rb
160
+ - spec/xednese/responses/batch_spec.rb
161
+ - spec/xednese/responses/batches_spec.rb
130
162
  - spec/xednese/responses/message_headers_spec.rb
131
- - spec/xednese/dispatcher_spec.rb
163
+ - spec/xednese/responses/status_spec.rb
164
+ - spec/xednese/batches_spec.rb
132
165
  - spec/xednese/messages_spec.rb
166
+ - spec/xednese/requests/account_spec.rb
167
+ - spec/xednese/requests/batch_spec.rb
133
168
  - spec/xednese/requests/messages_spec.rb
134
169
  - spec/xednese/client_spec.rb
135
170
  - spec/xednese/users_spec.rb
171
+ - spec/xednese/account/dispatcher_spec.rb
172
+ - spec/xednese/account/messages_spec.rb
136
173
  homepage: http://github.com/hawx/xednese
137
174
  licenses:
138
175
  - MIT
@@ -158,16 +195,29 @@ signing_key:
158
195
  specification_version: 4
159
196
  summary: Client library for interacting with the Esendex API
160
197
  test_files:
198
+ - scenarios/helper.rb
199
+ - scenarios/accounts/getting_all_accounts.rb
200
+ - scenarios/accounts/getting_an_account.rb
161
201
  - spec/helper.rb
162
202
  - spec/xednese_spec.rb
163
203
  - spec/xednese/accounts_spec.rb
204
+ - spec/xednese/account_spec.rb
205
+ - spec/xednese/batch_spec.rb
164
206
  - spec/xednese/responses/message_header_spec.rb
165
207
  - spec/xednese/responses/message_dispatcher_headers_spec.rb
166
208
  - spec/xednese/responses/accounts_spec.rb
167
209
  - spec/xednese/responses/account_spec.rb
210
+ - spec/xednese/responses/batch_spec.rb
211
+ - spec/xednese/responses/batches_spec.rb
168
212
  - spec/xednese/responses/message_headers_spec.rb
169
- - spec/xednese/dispatcher_spec.rb
213
+ - spec/xednese/responses/status_spec.rb
214
+ - spec/xednese/batches_spec.rb
170
215
  - spec/xednese/messages_spec.rb
216
+ - spec/xednese/requests/account_spec.rb
217
+ - spec/xednese/requests/batch_spec.rb
171
218
  - spec/xednese/requests/messages_spec.rb
172
219
  - spec/xednese/client_spec.rb
173
220
  - spec/xednese/users_spec.rb
221
+ - spec/xednese/account/dispatcher_spec.rb
222
+ - spec/xednese/account/messages_spec.rb
223
+ has_rdoc:
@@ -1,20 +0,0 @@
1
- class Esendex
2
- class Dispatcher
3
- def initialize(credentials)
4
- @credentials = credentials
5
- end
6
-
7
- def send(body, to)
8
- args = {
9
- account_reference: @credentials.account_reference,
10
- messages: [{to: to, body: body}]
11
- }
12
-
13
- messages = Requests::Messages.new(args)
14
-
15
- Client.post(@credentials, 'v1.0/messagedispatcher', messages) do |code, body|
16
- Responses::MessageDispatcherHeaders.deserialise(body)
17
- end
18
- end
19
- end
20
- end