your_membership 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dca31de77c1f07ea870f32e160e2791b5fea1fc
4
- data.tar.gz: a30728a8cea27ed96e36db41f8757226bd6cff6d
3
+ metadata.gz: eae6af7093fcd10224ba255ebddf1c6cb39cd7d8
4
+ data.tar.gz: fc90a242e95061cdf01d83602015664b0673cea6
5
5
  SHA512:
6
- metadata.gz: 0b230561fc1a29dcd04fe2ea5e558fa714a9b60f7df3abfe8e710a2c5cbf091f3001cf13d4658727ab1e6d0d5cc91dbb8e7a2ff7c3d3e8deb04cc0601b9ec11c
7
- data.tar.gz: 2a60452add253f288c85893c251e8975da116c5afc89eebd2f8ecdc9b3ca4032d5b0c444890796f34f78d683f97ab65dc1cce352cd7b298b61183999e4ebc573
6
+ metadata.gz: ea5a1efd9eeea94fd8863e2b5d1d6abea4e2e404832703a0567f9efd300020ae6a7ad650ba4e9959ba3f87a51f5a7da4ee28d62beb71a2fdf8ff223c6e89dea3
7
+ data.tar.gz: 6f07520885bfcae69f67c8f071414f483031f7884faa9749f0a89d603b62cb0d2865c1d8a8868c927a79a11ee51282b82b21a1166ac3d6cd0a479f06e9827649
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.1.4] - 2017-08-18
8
+ ### Fixed
9
+ - HTTParty monkey patch now handles nils properly.
10
+
7
11
  ## [1.1.3] - 2017-03-13
8
12
  ### Fixed
9
13
  - Allow YourMembership::Sa::Members.profile_create to pass along
data/README.md CHANGED
@@ -252,6 +252,11 @@ Thanks to grants and donations from people like you, ECHO is able to connect tra
252
252
 
253
253
  To find out more about ECHO, or to help with the work that is being done worldwide please visit http://www.echonet.org
254
254
 
255
+ ## Contributors
256
+ npflood
257
+ sbleon
258
+ mmccarthy15
259
+
255
260
  ## Contributing
256
261
 
257
262
  If you find a problem with this library or would like to contribute an improvement please fork and submit a pull request.
@@ -23,7 +23,7 @@ module HTTParty
23
23
  def fix_cdata(body)
24
24
  # <![CDATA[ = &lt;![CDATA[
25
25
  # ]]> = ]]&gt;
26
- if body.include? '&lt;![CDATA['
26
+ if !body.nil? && body.include?('&lt;![CDATA[')
27
27
  body.gsub! '&lt;![CDATA[', '<![CDATA['
28
28
  body.gsub! ']]&gt', ']]>'
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module YourMembership
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.yourmembership.com/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" encoding="UTF-8"?>
10
+ <YourMembership>
11
+ <Version>2.00</Version>
12
+ <ApiKey><PRIVATE_KEY></ApiKey>
13
+ <SaPasscode><SA_PASSCODE></SaPasscode>
14
+ <CallID>10000</CallID>
15
+ <Call Method="Sa.Members.All.GetIDs">
16
+ <Timestamp>2015-12-02 15:54:11</Timestamp>
17
+ </Call>
18
+ </YourMembership>
19
+ headers:
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ User-Agent:
25
+ - Ruby
26
+ response:
27
+ status:
28
+ code: 200
29
+ message: OK
30
+ headers:
31
+ Cache-Control:
32
+ - private
33
+ Content-Length:
34
+ - '24051'
35
+ Content-Type:
36
+ - text/xml; Charset=utf-8
37
+ Set-Cookie:
38
+ - "<ASP_SESSION_ID>"
39
+ X-Powered-By:
40
+ - ASP.NET
41
+ Date:
42
+ - Wed, 16 Dec 2015 20:54:12 GMT
43
+ Connection:
44
+ - Keep-alive
45
+ body:
46
+ string: null
47
+ http_version:
48
+ recorded_at: Wed, 16 Dec 2015 20:54:12 GMT
49
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.yourmembership.com/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" encoding="UTF-8"?>
10
+ <YourMembership>
11
+ <Version>2.00</Version>
12
+ <ApiKey><PRIVATE_KEY></ApiKey>
13
+ <SaPasscode><SA_PASSCODE></SaPasscode>
14
+ <CallID>10000</CallID>
15
+ <Call Method="Sa.Members.All.GetIDs">
16
+ <Timestamp>2015-12-02 15:54:11</Timestamp>
17
+ </Call>
18
+ </YourMembership>
19
+ headers:
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ Accept:
23
+ - "*/*"
24
+ User-Agent:
25
+ - Ruby
26
+ response:
27
+ status:
28
+ code: 200
29
+ message: OK
30
+ headers:
31
+ Cache-Control:
32
+ - private
33
+ Content-Length:
34
+ - '24051'
35
+ Content-Type:
36
+ - text/xml; Charset=utf-8
37
+ Set-Cookie:
38
+ - "<ASP_SESSION_ID>"
39
+ X-Powered-By:
40
+ - ASP.NET
41
+ Date:
42
+ - Wed, 16 Dec 2015 20:54:12 GMT
43
+ Connection:
44
+ - Keep-alive
45
+ body:
46
+ encoding: UTF-8
47
+ string: "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n\r\n<YourMembership_Response>\r\n<ErrCode>0</ErrCode>\r\n<ExtendedErrorInfo>&lt;![CDATA[Text information here]]&gt;</ExtendedErrorInfo>\r\n<Sa.Members.All.GetIDs>\r\n<ServerGmtBias>-5</ServerGmtBias>\r\n<ServerTime>2015-12-16
48
+ 15:54:12</ServerTime>\r\n<Members>\r\n<ID>57EEB598-CB44-4D85-B0D6-377F393AF5B4</ID>\r\n<ID>1C0CE647-FAA5-4EB0-ADF0-5B669B36378E</ID>\r\n</Members>\r\n</Sa.Members.All.GetIDs>\r\n</YourMembership_Response>\r\n"
49
+ http_version:
50
+ recorded_at: Wed, 16 Dec 2015 20:54:12 GMT
51
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,43 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.yourmembership.com/
6
+ body:
7
+ encoding: UTF-8
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - private
23
+ Content-Type:
24
+ - text/xml; Charset=utf-8
25
+ Vary:
26
+ - Accept-Encoding
27
+ Server:
28
+ - Microsoft-IIS/8.5
29
+ Set-Cookie:
30
+ - "<ASP_SESSION_ID>"
31
+ X-Powered-By:
32
+ - ASP.NET
33
+ Date:
34
+ - Thu, 17 Aug 2017 20:18:09 GMT
35
+ Content-Length:
36
+ - '301'
37
+ body:
38
+ encoding: ASCII-8BIT
39
+ string: "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n\r\n<YourMembership_Response>\r\n<ErrCode>902</ErrCode>\r\n<ExtendedErrorInfo></ExtendedErrorInfo>\r\n<ErrDesc>XML
40
+ packet is malformed or otherwise unreadable.</ErrDesc>\r\n<XmlRequest>\r\n<unnamed></unnamed>\r\n</XmlRequest>\r\n</YourMembership_Response>\r\n"
41
+ http_version:
42
+ recorded_at: Thu, 17 Aug 2017 20:18:09 GMT
43
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'FixCdata' do
4
+ it 'string returned' do
5
+ VCR.use_cassette 'sa_members_all_getids_timestamp_single' do
6
+ response = HTTParty.post("https://api.yourmembership.com/")
7
+ expect(response.body).to be_a(String)
8
+ end
9
+ end
10
+
11
+ it 'replace &lt;![CDATA' do
12
+ VCR.use_cassette 'sa_members_cdata' do
13
+ response = HTTParty.post("https://api.yourmembership.com/")
14
+ expect(response.body).to include("<![CDATA[")
15
+ end
16
+ end
17
+
18
+ it 'replace ]]&gt' do
19
+ VCR.use_cassette 'sa_members_cdata' do
20
+ response = HTTParty.post("https://api.yourmembership.com/")
21
+ expect(response.body).to include("]]>")
22
+ end
23
+ end
24
+
25
+ it 'handle blank body response' do
26
+ VCR.use_cassette 'no_body_response' do
27
+ # Note that a nil body is unlikely (never) to occur within YM, but other non-YM tools may respond with a nil body
28
+ response = HTTParty.post("https://api.yourmembership.com/")
29
+ expect(response.body).to be nil
30
+ end
31
+ end
32
+ end
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,7 @@ require 'dotenv'
2
2
  require 'pry'
3
3
  require 'vcr'
4
4
  require 'your_membership'
5
+ require 'webmock/rspec'
5
6
 
6
7
  Dotenv.load(
7
8
  File.expand_path('../../.env.local', __FILE__),
@@ -98,4 +99,3 @@ YourMembership.configure(
98
99
  privateKey: ENV.fetch('YM_API_PRIVATE_KEY'),
99
100
  saPasscode: ENV.fetch('YM_API_SA_PASSCODE')
100
101
  )
101
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: your_membership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Flood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -187,9 +187,13 @@ files:
187
187
  - lib/your_membership/sa_people.rb
188
188
  - lib/your_membership/session.rb
189
189
  - lib/your_membership/version.rb
190
+ - spec/fixtures/vcr_cassettes/no_body_response.yml
190
191
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_multiple.yml
191
192
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_none.yml
192
193
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_single.yml
194
+ - spec/fixtures/vcr_cassettes/sa_members_cdata.yml
195
+ - spec/fixtures/vcr_cassettes/sa_members_no_body.yml
196
+ - spec/lib/httparty/patch_spec.rb
193
197
  - spec/lib/your_membership/profile_spec.rb
194
198
  - spec/lib/your_membership/sa_members_spec.rb
195
199
  - spec/spec_helper.rb
@@ -219,9 +223,14 @@ signing_key:
219
223
  specification_version: 4
220
224
  summary: Ruby SDK for interfacing with the YourMembership.com XML API
221
225
  test_files:
226
+ - spec/fixtures/vcr_cassettes/no_body_response.yml
222
227
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_multiple.yml
223
228
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_none.yml
224
229
  - spec/fixtures/vcr_cassettes/sa_members_all_getids_timestamp_single.yml
230
+ - spec/fixtures/vcr_cassettes/sa_members_cdata.yml
231
+ - spec/fixtures/vcr_cassettes/sa_members_no_body.yml
232
+ - spec/lib/httparty/patch_spec.rb
225
233
  - spec/lib/your_membership/profile_spec.rb
226
234
  - spec/lib/your_membership/sa_members_spec.rb
227
235
  - spec/spec_helper.rb
236
+ has_rdoc: