pitcher 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pitcher/version.rb +1 -1
- data/lib/pitcher.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e861bd8150355ca0fbd17ec29881ccaefefd4a4
|
4
|
+
data.tar.gz: f1eefe6d3665160d8e6a065871c062dd2514129f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f799da4fb4c8b305fbc55cdf0a5bcd629ae56380f926a38fe7c2632437cae9d977e893c6266758fe59cbb12b2f0b8b1aa06231959fcff5fed12cd45b231eb90
|
7
|
+
data.tar.gz: 254b0e67aa692705c44e5951e198eb0c44a38c27aefd509193dbc95698589a635b04de2516d1785b490f394a8bbad78cd21eb8dbad0992915d58def39b517667
|
data/lib/pitcher/version.rb
CHANGED
data/lib/pitcher.rb
CHANGED
@@ -2,6 +2,7 @@ require 'pitcher/version'
|
|
2
2
|
require 'pitcher/options'
|
3
3
|
require 'savon'
|
4
4
|
require 'csv'
|
5
|
+
require 'nokogiri'
|
5
6
|
|
6
7
|
module Pitcher
|
7
8
|
class Pitcher
|
@@ -54,9 +55,14 @@ module Pitcher
|
|
54
55
|
)
|
55
56
|
# Create the hash that will be sent as a message to the service with the creds and data above
|
56
57
|
response = client.call(:process_conten_tdm, message: message)
|
57
|
-
#
|
58
|
+
# Get request body
|
58
59
|
request = client.build_request(:process_conten_tdm, message: message)
|
59
|
-
|
60
|
+
XML = request.body
|
61
|
+
# parse request body xml, extract username and metadata
|
62
|
+
doc = Nokogiri::XML(XML)
|
63
|
+
user = doc.at('username').text
|
64
|
+
# Write response to a file
|
65
|
+
File.open('response-' + user + '.txt', 'a') { |file| file.write("\r" + request.body + "\r" + response.body.to_hash[:process_conten_tdm_response][:return] ) }
|
60
66
|
end
|
61
67
|
end
|
62
68
|
end
|