responsys-api 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +7 -2
  3. data/lib/responsys/api/all.rb +2 -2
  4. data/lib/responsys/api/authentication.rb +45 -0
  5. data/lib/responsys/api/client.rb +21 -50
  6. data/lib/responsys/api/session.rb +22 -35
  7. data/lib/responsys/api/session_pool.rb +32 -0
  8. data/lib/responsys/configuration.rb +7 -2
  9. data/lib/responsys/i18n/en.yml +35 -0
  10. data/lib/responsys_api.rb +7 -1
  11. data/responsys-api.gemspec +3 -2
  12. data/spec/api/campaign_spec.rb +5 -5
  13. data/spec/api/client_spec.rb +7 -69
  14. data/spec/api/list_spec.rb +6 -6
  15. data/spec/api/session_spec.rb +50 -0
  16. data/spec/api/table_spec.rb +12 -12
  17. data/spec/api_credentials.sample.yml +1 -1
  18. data/spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml +45 -29
  19. data/spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_2.yml +45 -29
  20. data/spec/fixtures/vcr_cassettes/api/campaign/trigger_message_1.yml +926 -29
  21. data/spec/fixtures/vcr_cassettes/api/campaign/trigger_message_2.yml +45 -29
  22. data/spec/fixtures/vcr_cassettes/api/client/expired_session.yml +1 -48
  23. data/spec/fixtures/vcr_cassettes/api/list/merge.yml +46 -28
  24. data/spec/fixtures/vcr_cassettes/api/list/retrieve.yml +927 -28
  25. data/spec/fixtures/vcr_cassettes/api/list/retrieve_single.yml +46 -28
  26. data/spec/fixtures/vcr_cassettes/api/list/retrieve_single_single.yml +46 -28
  27. data/spec/fixtures/vcr_cassettes/api/profile_extension/delete_profile_extension_records.yml +65 -0
  28. data/spec/fixtures/vcr_cassettes/api/profile_extension/merge_profile_extension_records.yml +46 -28
  29. data/spec/fixtures/vcr_cassettes/api/profile_extension/retrieve_profile_extension_records.yml +46 -28
  30. data/spec/fixtures/vcr_cassettes/api/table/create_with_pk.yml +927 -28
  31. data/spec/fixtures/vcr_cassettes/api/table/delete_with_pk.yml +46 -28
  32. data/spec/fixtures/vcr_cassettes/member/present1.yml +927 -28
  33. data/spec/fixtures/vcr_cassettes/member/present2.yml +46 -28
  34. data/spec/fixtures/vcr_cassettes/member/present3.yml +46 -30
  35. data/spec/fixtures/vcr_cassettes/member/present4.yml +46 -30
  36. data/spec/fixtures/vcr_cassettes/member/present5.yml +46 -30
  37. data/spec/fixtures/vcr_cassettes/member/retrieve_profile_extension.yml +92 -56
  38. data/spec/spec_helper.rb +9 -19
  39. metadata +43 -23
@@ -12,28 +12,18 @@ else
12
12
  end
13
13
 
14
14
  DATA = YAML.load_file("#{File.dirname(__FILE__)}/test_data.yml")
15
- IGNORE_LOGIN_REQUEST = true
16
- IGNORE_LOGOUT_REQUEST = true
17
15
 
18
16
  VCR.configure do |c|
19
17
  c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
20
18
  c.hook_into :webmock
21
- c.ignore_request do |request|
22
- if request.to_hash["body"]["string"].empty?
23
- true
24
- else
25
- ignoring = false
26
-
27
- if IGNORE_LOGIN_REQUEST
28
- ignoring |= !Nokogiri::XML(request.to_hash["body"]["string"]).remove_namespaces!.xpath('/Envelope/Body/login', ).empty?
29
- end
30
-
31
- if IGNORE_LOGOUT_REQUEST
32
- ignoring |= !Nokogiri::XML(request.to_hash["body"]["string"]).remove_namespaces!.xpath('/Envelope/Body/logout', ).empty?
33
- end
34
-
35
- ignoring
36
- end
19
+ c.filter_sensitive_data("your_responsys_username") { CREDENTIALS["username"] }
20
+ c.filter_sensitive_data("your_responsys_password") { CREDENTIALS["password"] }
21
+ c.default_cassette_options = { match_requests_on: [:method, :uri, :body] }
22
+ c.before_record do |c|
23
+ c.request.headers = nil
24
+ c.response.headers = nil
25
+ c.request.body.sub!(/<sessionId>.*<\/sessionId>/, "<sessionId>DEAR_SESSION_ID</sessionId>")
26
+ c.response.body.sub!(/<sessionId>.*<\/sessionId>/, "<sessionId>DEAR_SESSION_ID</sessionId>")
37
27
  end
38
28
  end
39
29
 
@@ -42,6 +32,6 @@ Responsys.configure do |config|
42
32
  username: CREDENTIALS["username"],
43
33
  password: CREDENTIALS["password"],
44
34
  wsdl: CREDENTIALS["wsdl"],
45
- debug: false
35
+ element_form_default: :qualified
46
36
  }
47
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: responsys-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan DeMeyere
@@ -11,20 +11,20 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-11-24 00:00:00.000000000 Z
14
+ date: 2014-12-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rubyntlm
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ~>
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '0.4'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0.4'
30
30
  - !ruby/object:Gem::Dependency
@@ -59,84 +59,98 @@ dependencies:
59
59
  name: i18n
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ~>
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0.6'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ~>
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0.6'
72
+ - !ruby/object:Gem::Dependency
73
+ name: connection_pool
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '='
77
+ - !ruby/object:Gem::Version
78
+ version: 2.0.0
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '='
84
+ - !ruby/object:Gem::Version
85
+ version: 2.0.0
72
86
  - !ruby/object:Gem::Dependency
73
87
  name: bundler
74
88
  requirement: !ruby/object:Gem::Requirement
75
89
  requirements:
76
- - - ~>
90
+ - - "~>"
77
91
  - !ruby/object:Gem::Version
78
92
  version: '1.3'
79
93
  type: :development
80
94
  prerelease: false
81
95
  version_requirements: !ruby/object:Gem::Requirement
82
96
  requirements:
83
- - - ~>
97
+ - - "~>"
84
98
  - !ruby/object:Gem::Version
85
99
  version: '1.3'
86
100
  - !ruby/object:Gem::Dependency
87
101
  name: rake
88
102
  requirement: !ruby/object:Gem::Requirement
89
103
  requirements:
90
- - - ~>
104
+ - - "~>"
91
105
  - !ruby/object:Gem::Version
92
106
  version: '10.3'
93
107
  type: :development
94
108
  prerelease: false
95
109
  version_requirements: !ruby/object:Gem::Requirement
96
110
  requirements:
97
- - - ~>
111
+ - - "~>"
98
112
  - !ruby/object:Gem::Version
99
113
  version: '10.3'
100
114
  - !ruby/object:Gem::Dependency
101
115
  name: rspec
102
116
  requirement: !ruby/object:Gem::Requirement
103
117
  requirements:
104
- - - ~>
118
+ - - "~>"
105
119
  - !ruby/object:Gem::Version
106
- version: '3.0'
120
+ version: 3.1.0
107
121
  type: :development
108
122
  prerelease: false
109
123
  version_requirements: !ruby/object:Gem::Requirement
110
124
  requirements:
111
- - - ~>
125
+ - - "~>"
112
126
  - !ruby/object:Gem::Version
113
- version: '3.0'
127
+ version: 3.1.0
114
128
  - !ruby/object:Gem::Dependency
115
129
  name: vcr
116
130
  requirement: !ruby/object:Gem::Requirement
117
131
  requirements:
118
- - - ~>
132
+ - - "~>"
119
133
  - !ruby/object:Gem::Version
120
134
  version: '2.5'
121
135
  type: :development
122
136
  prerelease: false
123
137
  version_requirements: !ruby/object:Gem::Requirement
124
138
  requirements:
125
- - - ~>
139
+ - - "~>"
126
140
  - !ruby/object:Gem::Version
127
141
  version: '2.5'
128
142
  - !ruby/object:Gem::Dependency
129
143
  name: webmock
130
144
  requirement: !ruby/object:Gem::Requirement
131
145
  requirements:
132
- - - ~>
146
+ - - "~>"
133
147
  - !ruby/object:Gem::Version
134
148
  version: '1.9'
135
149
  type: :development
136
150
  prerelease: false
137
151
  version_requirements: !ruby/object:Gem::Requirement
138
152
  requirements:
139
- - - ~>
153
+ - - "~>"
140
154
  - !ruby/object:Gem::Version
141
155
  version: '1.9'
142
156
  description: A gem to integrate with the Responsys SOAP API
@@ -149,14 +163,15 @@ executables: []
149
163
  extensions: []
150
164
  extra_rdoc_files: []
151
165
  files:
152
- - .gitignore
153
- - .rspec
154
- - .travis.yml
166
+ - ".gitignore"
167
+ - ".rspec"
168
+ - ".travis.yml"
155
169
  - Gemfile
156
170
  - LICENSE.txt
157
171
  - README.md
158
172
  - Rakefile
159
173
  - lib/responsys/api/all.rb
174
+ - lib/responsys/api/authentication.rb
160
175
  - lib/responsys/api/campaign.rb
161
176
  - lib/responsys/api/client.rb
162
177
  - lib/responsys/api/folder.rb
@@ -175,6 +190,7 @@ files:
175
190
  - lib/responsys/api/object/record.rb
176
191
  - lib/responsys/api/object/record_data.rb
177
192
  - lib/responsys/api/session.rb
193
+ - lib/responsys/api/session_pool.rb
178
194
  - lib/responsys/api/table.rb
179
195
  - lib/responsys/configuration.rb
180
196
  - lib/responsys/exceptions/all.rb
@@ -192,6 +208,7 @@ files:
192
208
  - spec/api/object/recipient_data_spec.rb
193
209
  - spec/api/object/recipient_spec.rb
194
210
  - spec/api/object/record_data_spec.rb
211
+ - spec/api/session_spec.rb
195
212
  - spec/api/table_spec.rb
196
213
  - spec/api_credentials.sample.yml
197
214
  - spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml
@@ -203,6 +220,7 @@ files:
203
220
  - spec/fixtures/vcr_cassettes/api/list/retrieve.yml
204
221
  - spec/fixtures/vcr_cassettes/api/list/retrieve_single.yml
205
222
  - spec/fixtures/vcr_cassettes/api/list/retrieve_single_single.yml
223
+ - spec/fixtures/vcr_cassettes/api/profile_extension/delete_profile_extension_records.yml
206
224
  - spec/fixtures/vcr_cassettes/api/profile_extension/merge_profile_extension_records.yml
207
225
  - spec/fixtures/vcr_cassettes/api/profile_extension/retrieve_profile_extension_records.yml
208
226
  - spec/fixtures/vcr_cassettes/api/table/create_with_pk.yml
@@ -227,12 +245,12 @@ require_paths:
227
245
  - lib
228
246
  required_ruby_version: !ruby/object:Gem::Requirement
229
247
  requirements:
230
- - - ! '>='
248
+ - - ">="
231
249
  - !ruby/object:Gem::Version
232
250
  version: '0'
233
251
  required_rubygems_version: !ruby/object:Gem::Requirement
234
252
  requirements:
235
- - - ! '>='
253
+ - - ">="
236
254
  - !ruby/object:Gem::Version
237
255
  version: '0'
238
256
  requirements: []
@@ -249,6 +267,7 @@ test_files:
249
267
  - spec/api/object/recipient_data_spec.rb
250
268
  - spec/api/object/recipient_spec.rb
251
269
  - spec/api/object/record_data_spec.rb
270
+ - spec/api/session_spec.rb
252
271
  - spec/api/table_spec.rb
253
272
  - spec/api_credentials.sample.yml
254
273
  - spec/fixtures/vcr_cassettes/api/campaign/trigger_custom_event_1.yml
@@ -260,6 +279,7 @@ test_files:
260
279
  - spec/fixtures/vcr_cassettes/api/list/retrieve.yml
261
280
  - spec/fixtures/vcr_cassettes/api/list/retrieve_single.yml
262
281
  - spec/fixtures/vcr_cassettes/api/list/retrieve_single_single.yml
282
+ - spec/fixtures/vcr_cassettes/api/profile_extension/delete_profile_extension_records.yml
263
283
  - spec/fixtures/vcr_cassettes/api/profile_extension/merge_profile_extension_records.yml
264
284
  - spec/fixtures/vcr_cassettes/api/profile_extension/retrieve_profile_extension_records.yml
265
285
  - spec/fixtures/vcr_cassettes/api/table/create_with_pk.yml