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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fc05930e820c857ab114f8dc23f3319d7851726
4
- data.tar.gz: 7ae08a8fa5796a6bdf81eec8872141e564a5c5d2
3
+ metadata.gz: 0e861bd8150355ca0fbd17ec29881ccaefefd4a4
4
+ data.tar.gz: f1eefe6d3665160d8e6a065871c062dd2514129f
5
5
  SHA512:
6
- metadata.gz: 401c8691904d90a0112240d84dd46207502a8b1bd047ed9da4ee5d21bfaf5f48c074b0402501c28f4bf67dd4b1c79cb4facad120189efeefca102fd26f628731
7
- data.tar.gz: e17126081c3e71dd940ecc1beff220db759312a922ac3687b1b32b8fdece5f91f97b666d5c43322d104b07a9a3fcdc86b5ff5cd904608b4aa4610424f3091d37
6
+ metadata.gz: 7f799da4fb4c8b305fbc55cdf0a5bcd629ae56380f926a38fe7c2632437cae9d977e893c6266758fe59cbb12b2f0b8b1aa06231959fcff5fed12cd45b231eb90
7
+ data.tar.gz: 254b0e67aa692705c44e5951e198eb0c44a38c27aefd509193dbc95698589a635b04de2516d1785b490f394a8bbad78cd21eb8dbad0992915d58def39b517667
@@ -1,3 +1,3 @@
1
1
  module Pitcher
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
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
- # Write response to a file
58
+ # Get request body
58
59
  request = client.build_request(:process_conten_tdm, message: message)
59
- File.open('response.txt', 'a') { |file| file.write("\r" + request.body + "\r" + response.body.to_hash[:process_conten_tdm_response][:return] ) }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pitcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamie Little