undees / rforce (http://rforce.rubyforge.org)

A simple, usable binding to the SalesForce API.

Clone this repository (size: 109.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/undees/rforce/

Changed (Δ63 bytes):

raw changeset »

lib/rforce.rb (2 lines added, 2 lines removed)

lib/rforce/soap_response_hpricot.rb (3 lines added, 3 lines removed)

lib/rforce/soap_response_rexml.rb (1 lines added, 1 lines removed)

Up to file-list lib/rforce.rb:

@@ -63,8 +63,8 @@ require 'facets/openhash'
63
63
64
64
require 'rforce/binding'
65
65
require 'rforce/soap_response_rexml'
66
require 'rforce/soap_response_hpricot' rescue nil
67
require 'rforce/soap_response_expat' rescue nil
66
begin; require 'rforce/soap_response_hpricot'; rescue LoadError; end
67
begin; require 'rforce/soap_response_expat'; rescue LoadError; end
68
68
69
69
70
70
module RForce

Up to file-list lib/rforce/soap_response_hpricot.rb:

@@ -19,16 +19,16 @@ module RForce
19
19
    
20
20
    def self.node_to_ruby(node)
21
21
      # Convert text nodes into simple strings.
22
      children = node.children.reject do |c|
22
      children = (node.children || []).reject do |c|
23
23
        c.is_a?(Hpricot::Text) && c.to_s.strip.empty?
24
24
      end
25
25
26
26
      if node.is_a?(Hpricot::Text)
27
        return node.inner_text
27
        return node.inner_text.to_s
28
28
      end
29
29
      
30
30
      if children.first.is_a?(Hpricot::Text)
31
        return children.first
31
        return children.first.to_s
32
32
      end
33
33
34
34
      # Convert nodes with children into MethodHashes.

Up to file-list lib/rforce/soap_response_rexml.rb:

@@ -11,7 +11,7 @@ module RForce
11
11
12
12
    %w(attlistdecl cdata comment doctype doctype_end elementdecl
13
13
       entity entitydecl instruction notationdecl xmldecl).each do |unused|
14
      define_method(unused) {}
14
      define_method(unused) {|*args|}
15
15
    end
16
16
17
17
    def initialize(content)