rforce 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -1,3 +1,4 @@
1
+ .gemtest
1
2
  History.txt
2
3
  Manifest.txt
3
4
  README.txt
data/README.txt CHANGED
@@ -18,10 +18,10 @@ Rather than enforcing adherence to the sforce.com schema, RForce assumes you are
18
18
  === Logging in with a user name and password
19
19
 
20
20
  binding = RForce::Binding.new \
21
- 'https://www.salesforce.com/services/Soap/u/10.0'
21
+ 'https://www.salesforce.com/services/Soap/u/20.0'
22
22
 
23
23
  binding.login \
24
- 'email', 'password_with_token'
24
+ 'email', 'password' + 'token'
25
25
 
26
26
  === Logging in with OAuth
27
27
 
data/Rakefile CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  $:.unshift './lib'
4
4
 
5
- require 'rubygems'
6
- gem 'hoe', '~> 2.8'
7
5
  require 'hoe'
8
6
  require 'hoe/gemspec2'
9
7
 
@@ -15,7 +13,7 @@ Hoe.spec 'rforce' do
15
13
  self.extra_deps << ['builder', '~> 3.0']
16
14
  self.extra_deps << ['oauth', '~> 0.4']
17
15
 
18
- self.extra_dev_deps << ['rspec', '~> 1.3']
16
+ self.extra_dev_deps << ['rspec', '~> 2.8']
19
17
  self.extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
20
18
 
21
19
  self.rdoc_locations = ['undees@rforce.rubyforge.org:/var/www/gforge-projects/rforce']
@@ -24,6 +22,8 @@ Hoe.spec 'rforce' do
24
22
  self.rspec_options = ['-rubygems', '--options', 'spec/spec.opts']
25
23
  end
26
24
 
25
+ task :test => :spec
26
+
27
27
  Dir['tasks/**/*.rake'].each { |rake| load rake }
28
28
 
29
29
  # vim: syntax=Ruby
@@ -24,7 +24,7 @@ module RForce
24
24
  <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
25
25
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
26
26
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
27
- xmlns:partner="urn:partner.soap.sforce.com">
27
+ xmlns:partner="urn:partner.soap.sforce.com"
28
28
  xmlns:spartner="urn:sobject.partner.soap.sforce.com">
29
29
  <soap:Header>
30
30
  <partner:SessionHeader soap:mustUnderstand='1'>
@@ -49,9 +49,13 @@ module RForce
49
49
  # Connect to the server securely. If you pass an oauth hash, it
50
50
  # must contain the keys :consumer_key, :consumer_secret,
51
51
  # :access_token, :access_secret, and :login_url.
52
- def initialize(url, sid = nil, oauth = nil)
52
+ #
53
+ # proxy may be a URL of the form http://user:pass@example.com:port
54
+ #
55
+ def initialize(url, sid = nil, oauth = nil, proxy = nil)
53
56
  @session_id = sid
54
57
  @oauth = oauth
58
+ @proxy = proxy
55
59
  @batch_size = DEFAULT_BATCH_SIZE
56
60
 
57
61
  init_server(url)
@@ -70,7 +74,10 @@ module RForce
70
74
  consumer = OAuth::Consumer.new \
71
75
  @oauth[:consumer_key],
72
76
  @oauth[:consumer_secret],
73
- { :site => url }
77
+ {
78
+ :site => url,
79
+ :proxy => @proxy
80
+ }
74
81
 
75
82
  consumer.http.set_debug_output $stderr if show_debug
76
83
 
@@ -83,7 +90,7 @@ module RForce
83
90
  alias_method :post2, :post
84
91
  end
85
92
  else
86
- @server = Net::HTTP.new(@url.host, @url.port)
93
+ @server = Net::HTTP.Proxy(@proxy).new(@url.host, @url.port)
87
94
  @server.use_ssl = @url.scheme == 'https'
88
95
  @server.verify_mode = OpenSSL::SSL::VERIFY_NONE
89
96
 
@@ -92,16 +99,21 @@ module RForce
92
99
  end
93
100
  end
94
101
 
102
+ # Connect to remote server
103
+ #
104
+ def connect(user, password)
105
+ @user = user
106
+ @password = password
107
+
108
+ call_remote(:login, [:username, user, :password, password])
109
+ end
95
110
 
96
111
  # Log in to the server with a user name and password, remembering
97
112
  # the session ID returned to us by Salesforce.
98
113
  def login(user, password)
99
- @user = user
100
- @password = password
101
-
102
- response = call_remote(:login, [:username, user, :password, password])
114
+ response = connect(user, password)
103
115
 
104
- raise "Incorrect user name / password [#{response.fault}]" unless response.loginResponse
116
+ raise "Incorrect user name / password [#{response.Fault}]" unless response.loginResponse
105
117
 
106
118
  result = response[:loginResponse][:result]
107
119
  @session_id = result[:sessionId]
@@ -248,11 +260,11 @@ module RForce
248
260
 
249
261
  # Turns method calls on this object into remote SOAP calls.
250
262
  def method_missing(method, *args)
251
- unless args.size == 1 && [Hash, Array].include?(args[0].class)
252
- raise 'Expected 1 Hash or Array argument'
263
+ unless args.empty? || (args.size == 1 && [Hash, Array].include?(args[0].class))
264
+ raise 'Expected at most 1 Hash or Array argument'
253
265
  end
254
266
 
255
- call_remote method, args[0]
267
+ call_remote method, args[0] || []
256
268
  end
257
269
  end
258
270
  end
@@ -1,3 +1,3 @@
1
1
  module RForce
2
- VERSION = '0.7'
2
+ VERSION = '0.8'
3
3
  end
@@ -18,12 +18,12 @@ module RForceXmlMatchers
18
18
 
19
19
  @expected.each_with_index do |exp_rec, index|
20
20
  act_rec = @actual[index]
21
-
21
+
22
22
  # Only bother to look at the first <Id>
23
23
  # tag in a (presumably) duplicated set.
24
24
  act_id = first_id(act_rec[:Id])
25
25
  exp_id = first_id(exp_rec[:Id])
26
-
26
+
27
27
  return false if different '<Id>', act_id, exp_id
28
28
  return false if different 'keys', act_rec.keys, exp_rec.keys
29
29
 
@@ -61,6 +61,6 @@ module RForceXmlMatchers
61
61
  end
62
62
  end
63
63
 
64
- Spec::Runner.configure do |config|
64
+ RSpec.configure do |config|
65
65
  config.include(RForceXmlMatchers)
66
66
  end
metadata CHANGED
@@ -1,110 +1,93 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rforce
3
- version: !ruby/object:Gem::Version
4
- hash: 5
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.8'
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- version: "0.7"
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Ian Dees
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-02-05 00:00:00 -08:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-29 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: builder
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70294392794600 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 7
29
- segments:
30
- - 3
31
- - 0
32
- version: "3.0"
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: oauth
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70294392794600
25
+ - !ruby/object:Gem::Dependency
26
+ name: oauth
27
+ requirement: &70294392793960 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
29
+ requirements:
41
30
  - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- - 4
47
- version: "0.4"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.4'
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: rspec
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *70294392793960
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ requirement: &70294392793160 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
40
+ requirements:
56
41
  - - ~>
57
- - !ruby/object:Gem::Version
58
- hash: 9
59
- segments:
60
- - 1
61
- - 3
62
- version: "1.3"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.8'
63
44
  type: :development
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
45
+ prerelease: false
46
+ version_requirements: *70294392793160
47
+ - !ruby/object:Gem::Dependency
66
48
  name: hoe-gemspec2
49
+ requirement: &70294392792460 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.1'
55
+ type: :development
67
56
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ version_requirements: *70294392792460
58
+ - !ruby/object:Gem::Dependency
59
+ name: rdoc
60
+ requirement: &70294392791540 !ruby/object:Gem::Requirement
69
61
  none: false
70
- requirements:
62
+ requirements:
71
63
  - - ~>
72
- - !ruby/object:Gem::Version
73
- hash: 13
74
- segments:
75
- - 1
76
- - 1
77
- version: "1.1"
64
+ - !ruby/object:Gem::Version
65
+ version: '3.10'
78
66
  type: :development
79
- version_requirements: *id004
80
- - !ruby/object:Gem::Dependency
81
- name: hoe
82
67
  prerelease: false
83
- requirement: &id005 !ruby/object:Gem::Requirement
68
+ version_requirements: *70294392791540
69
+ - !ruby/object:Gem::Dependency
70
+ name: hoe
71
+ requirement: &70294392790720 !ruby/object:Gem::Requirement
84
72
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 47
89
- segments:
90
- - 2
91
- - 8
92
- - 0
93
- version: 2.8.0
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: '2.13'
94
77
  type: :development
95
- version_requirements: *id005
78
+ prerelease: false
79
+ version_requirements: *70294392790720
96
80
  description: RForce is a simple, usable binding to the Salesforce API.
97
- email:
81
+ email:
98
82
  - undees@gmail.com
99
83
  executables: []
100
-
101
84
  extensions: []
102
-
103
- extra_rdoc_files:
85
+ extra_rdoc_files:
104
86
  - History.txt
105
87
  - Manifest.txt
106
88
  - README.txt
107
- files:
89
+ files:
90
+ - .gemtest
108
91
  - History.txt
109
92
  - Manifest.txt
110
93
  - README.txt
@@ -124,40 +107,30 @@ files:
124
107
  - spec/spec.opts
125
108
  - spec/spec_helper.rb
126
109
  - tasks/timing.rake
127
- has_rdoc: true
128
110
  homepage: http://rforce.rubyforge.org
129
111
  licenses: []
130
-
131
112
  post_install_message:
132
- rdoc_options:
113
+ rdoc_options:
133
114
  - --main
134
115
  - README.txt
135
- require_paths:
116
+ require_paths:
136
117
  - lib
137
- required_ruby_version: !ruby/object:Gem::Requirement
118
+ required_ruby_version: !ruby/object:Gem::Requirement
138
119
  none: false
139
- requirements:
140
- - - ">="
141
- - !ruby/object:Gem::Version
142
- hash: 3
143
- segments:
144
- - 0
145
- version: "0"
146
- required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
125
  none: false
148
- requirements:
149
- - - ">="
150
- - !ruby/object:Gem::Version
151
- hash: 3
152
- segments:
153
- - 0
154
- version: "0"
126
+ requirements:
127
+ - - ! '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
155
130
  requirements: []
156
-
157
131
  rubyforge_project: rforce
158
- rubygems_version: 1.4.1
132
+ rubygems_version: 1.8.10
159
133
  signing_key:
160
134
  specification_version: 3
161
135
  summary: RForce is a simple, usable binding to the Salesforce API.
162
136
  test_files: []
163
-