rforcedotcom 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,66 @@
1
+ gem 'builder'
2
+ require 'rforce'
3
+
4
+ include RForce
5
+
6
+ module RForceXmlMatchers
7
+ class Resemble
8
+ def initialize(expected)
9
+ @expected = expected
10
+ end
11
+
12
+ def matches?(actual)
13
+ @actual = actual
14
+
15
+ return false if different 'size',
16
+ @actual.size,
17
+ @expected.size
18
+
19
+ @expected.each_with_index do |exp_rec, index|
20
+ act_rec = @actual[index]
21
+
22
+ # Only bother to look at the first <Id>
23
+ # tag in a (presumably) duplicated set.
24
+ act_id = first_id(act_rec[:Id])
25
+ exp_id = first_id(exp_rec[:Id])
26
+
27
+ return false if different '<Id>', act_id, exp_id
28
+ return false if different 'keys', act_rec.keys, exp_rec.keys
29
+
30
+ exp_rec.each do |key, _|
31
+ unless key == :Id
32
+ return false if different key, act_rec[key], exp_rec[key]
33
+ end
34
+ end
35
+ end
36
+
37
+ return true
38
+ end
39
+
40
+ def failure_message_for_should
41
+ %Q{expected "#{@actual.to_s[0..9]}..." } +
42
+ %Q{to resemble "#{@expected.to_s[0..9]}...":\n} +
43
+ @difference
44
+ end
45
+
46
+ private
47
+
48
+ def first_id(id)
49
+ id.is_a?(Array) ? id.first : id
50
+ end
51
+
52
+ def different(name, act, exp)
53
+ return nil if act == exp
54
+ @difference = %Q{ for #{name}, got:\n } +
55
+ %Q{#{act.inspect}\n expected:\n #{exp.inspect}}
56
+ end
57
+ end
58
+
59
+ def resemble(expected)
60
+ Resemble.new(expected)
61
+ end
62
+ end
63
+
64
+ Spec::Runner.configure do |config|
65
+ config.include(RForceXmlMatchers)
66
+ end
data/tasks/timing.rake ADDED
@@ -0,0 +1,21 @@
1
+ require 'rforce'
2
+
3
+ desc 'Perform a crude comparison of the various response parsers'
4
+ task :timing do
5
+ fname = File.join(File.dirname(__FILE__), '../spec/soap-response.xml')
6
+ contents = File.open(fname) {|f| f.read}
7
+
8
+ [:SoapResponseRexml,
9
+ :SoapResponseExpat,
10
+ :SoapResponseHpricot].each do |name|
11
+ begin
12
+ klass = RForce.const_get name
13
+ started_at = Time.now
14
+ klass.new(contents).parse
15
+ elapsed = Time.now - started_at
16
+ puts "#{klass}: #{elapsed}"
17
+ rescue NameError
18
+ # no-op
19
+ end
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rforcedotcom
3
+ version: !ruby/object:Gem::Version
4
+ hash: 191
5
+ prerelease: false
6
+ segments:
7
+ - 20
8
+ - 0
9
+ - 0
10
+ version: 20.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Quinton Wall
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-02-04 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: RForcedotcom is a fork of RForce which provides the connection to Force.com.
23
+ email: qwall@salesforce.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - History.txt
32
+ - README.txt
33
+ - Rakefile
34
+ - lib/rforce.rb
35
+ - lib/rforce/binding.rb
36
+ - lib/rforce/soap_pullable.rb
37
+ - lib/rforce/soap_response.rb
38
+ - lib/rforce/soap_response_expat.rb
39
+ - lib/rforce/soap_response_hpricot.rb
40
+ - lib/rforce/soap_response_rexml.rb
41
+ - lib/rforce/version.rb
42
+ - spec/rforce_spec.rb
43
+ - spec/soap-response.xml
44
+ - spec/spec.opts
45
+ - spec/spec_helper.rb
46
+ - tasks/timing.rake
47
+ has_rdoc: true
48
+ homepage: http://developer.force.com/
49
+ licenses: []
50
+
51
+ post_install_message:
52
+ rdoc_options: []
53
+
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.3.7
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: RForcedotcom is a fork of RForce which provides the connection to Force.com
81
+ test_files: []
82
+