Skip to content

Commit

Permalink
fix for bug id 20635 and added GPL to gem rake task
Browse files Browse the repository at this point in the history
git-svn-id: svn://rubyforge.org/var/svn/rubyhealthvault/trunk@15 5e59f7e3-561f-4167-93e6-46889eec4fca
  • Loading branch information
dannycoates committed Jun 19, 2008
1 parent 98a547f commit 91cee51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -119,7 +119,7 @@ spec = Gem::Specification.new do |s|
s.author = 'Danny Coates'
s.email = 'dcoates@podfitness.com'
# s.executables = ['your_executable_here']
s.files = %w(LICENSE README Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
s.files = %w(GPL LICENSE README Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
s.require_path = "lib"
s.bindir = "bin"
end
Expand Down
17 changes: 11 additions & 6 deletions lib/response.rb
Expand Up @@ -17,18 +17,24 @@ class Response
attr_reader :xml, :info

def initialize(http_response)
@http_response = http_response
@xml = Document.new(@http_response.body)
#@http_response = http_response
@xml = Document.new(http_response.body)
code = XPath.first(@xml, "//code").text
if code.to_i > 0
msg = XPath.first(@xml, "//error/message").text
Configuration.instance.logger.error "ERRORCODE: #{code.to_s} MESSAGE: #{msg}"
raise StandardError.new(msg)
end
Configuration.instance.logger.debug @xml.to_s
info_node = XPath.first(@xml, '//wc:info')
response_namespace = info_node.attribute('xmlns:wc').to_s
m = response_namespace.match(/urn\:com\.microsoft\.wc\.(.*)/)
begin
info_node = XPath.first(@xml, '//wc:info')
response_namespace = info_node.attribute('xmlns:wc').to_s
m = response_namespace.match(/urn\:com\.microsoft\.wc\.(.*)/)
rescue => e
Configuration.instance.logger.warn @xml
Configuration.instance.logger.warn e
m = nil
end
if m.nil?
@info = nil
else
Expand All @@ -39,7 +45,6 @@ def initialize(http_response)
@info = nfo
@info.parse_element(info_node)
rescue => e
puts e
Configuration.instance.logger.error e
@info = nil
end
Expand Down

0 comments on commit 91cee51

Please sign in to comment.