restforce 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of restforce might be problematic. Click here for more details.

data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ test.rb
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
data/README.md CHANGED
@@ -89,8 +89,8 @@ You can set any of the options passed into Restforce::Client.new globally:
89
89
 
90
90
  ```ruby
91
91
  Restforce.configure do |config|
92
- config.client_id = ENV['SALESFORCE_CLIENT_ID']
93
- config.client_secret = ENV['SALESFORCE_CLIENT_SECRET']
92
+ config.client_id = ENV['SALESFORCE_CLIENT_ID']
93
+ config.client_secret = ENV['SALESFORCE_CLIENT_SECRET']
94
94
  end
95
95
  ```
96
96
 
@@ -142,6 +142,14 @@ client.update('Account', Id: '0016000000MRatd', Name: 'Whizbang Corp')
142
142
  # => true
143
143
  ```
144
144
 
145
+
146
+ ### Upsert
147
+
148
+ ```ruby
149
+ # Update the record with external ID of 12
150
+ client.upsert('Account', 'External__c', External__c: 12, Name: 'Foobar')
151
+ ```
152
+
145
153
  ### Destroy
146
154
 
147
155
  ```ruby
@@ -152,6 +160,8 @@ client.destroy('Account', '0016000000MRatd')
152
160
 
153
161
  ### File Uploads
154
162
 
163
+ Using the new [Blob Data](http://www.salesforce.com/us/developer/docs/api_rest/Content/dome_sobject_insert_update_blob.htm) api feature (500mb limit):
164
+
155
165
  ```ruby
156
166
  client.create 'Document', FolderId: '00lE0000000FJ6H',
157
167
  Description: 'Document test',
@@ -159,6 +169,38 @@ client.create 'Document', FolderId: '00lE0000000FJ6H',
159
169
  Body: Restforce::UploadIO.new(File.expand_path('image.jpg', __FILE__), 'image/jpeg'))
160
170
  ```
161
171
 
172
+ Using base64 encoded data (37.5mb limit):
173
+
174
+ ```ruby
175
+ client.create 'Document', FolderId: '00lE0000000FJ6H',
176
+ Description: 'Document test',
177
+ Name: 'My image',
178
+ Body: Base64::encode64(File.read('image.jpg'))
179
+ ```
180
+
181
+ ### Streaming
182
+
183
+ Restforce supports the [Streaming API](http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API), and makes implementing
184
+ pub/sub with Salesforce a trivial task:
185
+
186
+ ```ruby
187
+ # Initialize a client with your username/password/oauth token/etc
188
+ client = Restforce::Client.new
189
+
190
+ # Force an authentication request
191
+ client.authenticate!
192
+
193
+ EM.run {
194
+ # Assuming you've setup a PushTopic called 'AllAccounts' (See the link above.)
195
+ client.subscribe 'AllAccounts' do |message|
196
+ puts message.inspect
197
+ end
198
+ }
199
+ ```
200
+
201
+ Boom, you're now receiving push notifications when Accounts are
202
+ created/updated.
203
+
162
204
  ## Contributing
163
205
 
164
206
  1. Fork it
data/lib/restforce.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'faraday'
2
2
  require 'faraday_middleware'
3
3
  require 'json'
4
+ require 'faye'
4
5
 
5
6
  require 'restforce/version'
6
7
  require 'restforce/config'
@@ -110,6 +110,8 @@ module Restforce
110
110
 
111
111
  # Public: Executs a SOQL query and returns the result.
112
112
  #
113
+ # soql - A SOQL expression.
114
+ #
113
115
  # Examples
114
116
  #
115
117
  # # Find the names of all Accounts
@@ -118,13 +120,15 @@ module Restforce
118
120
  #
119
121
  # Returns a Restforce::Collection if Restforce.configuration.mashify is true.
120
122
  # Returns an Array of Hash for each record in the result if Restforce.configuration.mashify is false.
121
- def query(query)
122
- response = api_get 'query', q: query
123
+ def query(soql)
124
+ response = api_get 'query', q: soql
123
125
  mashify? ? response.body : response.body['records']
124
126
  end
125
127
 
126
128
  # Public: Perform a SOSL search
127
129
  #
130
+ # sosl - A SOSL expression.
131
+ #
128
132
  # Examples
129
133
  #
130
134
  # # Find all occurrences of 'bar'
@@ -137,8 +141,8 @@ module Restforce
137
141
  #
138
142
  # Returns a Restforce::Collection if Restforce.configuration.mashify is true.
139
143
  # Returns an Array of Hash for each record in the result if Restforce.configuration.mashify is false.
140
- def search(term)
141
- response = api_get 'search', q: term
144
+ def search(sosl)
145
+ response = api_get 'search', q: sosl
142
146
  response.body
143
147
  end
144
148
 
@@ -150,8 +154,19 @@ module Restforce
150
154
  # client.create('Account', Name: 'Foobar Inc.')
151
155
  # # => '0016000000MRatd'
152
156
  #
153
- # Returns the String Id of the newly created sobject.
157
+ # Returns the String Id of the newly created sobject. Returns false if
158
+ # something bad happens
154
159
  def create(sobject, attrs)
160
+ create!(sobject, attrs)
161
+ rescue *exceptions
162
+ false
163
+ end
164
+
165
+ # See .create
166
+ #
167
+ # Returns the String Id of the newly created sobject. Raises an error if
168
+ # something bad happens.
169
+ def create!(sobject, attrs)
155
170
  response = api_post "sobjects/#{sobject}", attrs
156
171
  response.body['id']
157
172
  end
@@ -166,7 +181,7 @@ module Restforce
166
181
  # Returns true if the sobject was successfully updated, false otherwise.
167
182
  def update(sobject, attrs)
168
183
  update!(sobject, attrs)
169
- rescue Faraday::Error::ResourceNotFound
184
+ rescue *exceptions
170
185
  false
171
186
  end
172
187
 
@@ -180,6 +195,37 @@ module Restforce
180
195
  true
181
196
  end
182
197
 
198
+ # Public: Update or Create a record based on an external ID
199
+ #
200
+ # sobject - The name of the sobject to created.
201
+ # field - The name of the external Id field to match against.
202
+ # attrs - Hash of attributes for the record.
203
+ #
204
+ # Examples
205
+ #
206
+ # # Update the record with external ID of 12
207
+ # client.upsert('Account', 'External__c', External__c: 12, Name: 'Foobar')
208
+ #
209
+ # Returns true if the record was found and updated.
210
+ # Returns the Id of the newly created record if the record was created.
211
+ # Returns false if something bad happens.
212
+ def upsert(sobject, field, attrs)
213
+ upsert!(sobject, field, attrs)
214
+ rescue *exceptions
215
+ false
216
+ end
217
+
218
+ # See .upsert
219
+ #
220
+ # Returns true if the record was found and updated.
221
+ # Returns the Id of the newly created record if the record was created.
222
+ # Raises an error if something bad happens.
223
+ def upsert!(sobject, field, attrs)
224
+ external_id = attrs.has_key?(field.to_sym) ? attrs.delete(field.to_sym) : attrs.delete(field.to_s)
225
+ response = api_patch "sobjects/#{sobject}/#{field.to_s}/#{external_id}", attrs
226
+ (response.body && response.body['id']) ? response.body['id'] : true
227
+ end
228
+
183
229
  # Public: Delete a record.
184
230
  #
185
231
  # Examples
@@ -190,7 +236,7 @@ module Restforce
190
236
  # Returns true if the sobject was successfully deleted, false otherwise.
191
237
  def destroy(sobject, id)
192
238
  destroy!(sobject, id)
193
- rescue Faraday::Error::ResourceNotFound
239
+ rescue *exceptions
194
240
  false
195
241
  end
196
242
 
@@ -203,6 +249,24 @@ module Restforce
203
249
  true
204
250
  end
205
251
 
252
+ # Public: Subscribe to a PushTopic
253
+ #
254
+ # channel - The name of the PushTopic channel to subscribe to.
255
+ # block - A block to run when a new message is received.
256
+ #
257
+ # Returns a Faye::Subscription
258
+ def subscribe(channel, &block)
259
+ faye.subscribe "/topic/#{channel}", &block
260
+ end
261
+
262
+ # Public: Force an authentication
263
+ def authenticate!
264
+ connection.headers['X-ForceAuthenticate'] = true
265
+ get nil
266
+ ensure
267
+ connection.headers.delete('X-ForceAuthenticate')
268
+ end
269
+
206
270
  # Public: Helper methods for performing arbitrary actions against the API using
207
271
  # various HTTP verbs.
208
272
  #
@@ -275,7 +339,7 @@ module Restforce
275
339
  if username_password?
276
340
  Restforce::Middleware::Authentication::Password
277
341
  elsif oauth_refresh?
278
- Restforce::Middleware::Authentication::OAuth
342
+ Restforce::Middleware::Authentication::Token
279
343
  end
280
344
  end
281
345
 
@@ -292,8 +356,7 @@ module Restforce
292
356
  # Internal: Returns true if oauth token refresh flow should be used for
293
357
  # authentication.
294
358
  def oauth_refresh?
295
- @options[:oauth_token] &&
296
- @options[:refresh_token] &&
359
+ @options[:refresh_token] &&
297
360
  @options[:client_id] &&
298
361
  @options[:client_secret]
299
362
  end
@@ -303,5 +366,23 @@ module Restforce
303
366
  def mashify?
304
367
  connection.builder.handlers.find { |handler| handler == Restforce::Middleware::Mashify }
305
368
  end
369
+
370
+ # Internal: Errors that should be rescued from in non-bang methods
371
+ def exceptions
372
+ [Faraday::Error::ClientError]
373
+ end
374
+
375
+ # Internal: Faye client to use for subscribing to PushTopics
376
+ def faye
377
+ @faye ||= Faye::Client.new("#{@options[:instance_url]}/cometd/#{@options[:api_version]}").tap do |client|
378
+ client.set_header 'Authorization', "OAuth #{@options[:oauth_token]}"
379
+ client.bind 'transport:down' do
380
+ Restforce.log "[COMETD DOWN]"
381
+ end
382
+ client.bind 'transport:up' do
383
+ Restforce.log "[COMETD UP]"
384
+ end
385
+ end
386
+ end
306
387
  end
307
388
  end
@@ -6,12 +6,7 @@ module Restforce
6
6
  @client = client
7
7
  @total_size = hash['totalSize']
8
8
  @next_page_url = hash['nextRecordsUrl']
9
- super(self.build(hash['records']))
10
- end
11
-
12
- # Converts an array of Hash's into an array of Restforce::SObject.
13
- def build(array)
14
- array.map { |record| Restforce::SObject.new(record, @client) }
9
+ super(Restforce::Mash.build(hash['records'], @client))
15
10
  end
16
11
 
17
12
  def next_page
@@ -24,7 +24,7 @@ end
24
24
  require 'restforce/middleware/raise_error'
25
25
  require 'restforce/middleware/authentication'
26
26
  require 'restforce/middleware/authentication/password'
27
- require 'restforce/middleware/authentication/oauth'
27
+ require 'restforce/middleware/authentication/token'
28
28
  require 'restforce/middleware/authorization'
29
29
  require 'restforce/middleware/instance_url'
30
30
  require 'restforce/middleware/mashify'
@@ -8,6 +8,7 @@ module Restforce
8
8
 
9
9
  def call(env)
10
10
  begin
11
+ return authenticate! if force_authenticate?(env)
11
12
  @app.call(env)
12
13
  rescue Restforce::UnauthorizedError
13
14
  authenticate!
@@ -26,6 +27,10 @@ module Restforce
26
27
  builder.adapter Faraday.default_adapter
27
28
  end
28
29
  end
30
+
31
+ def force_authenticate?(env)
32
+ env[:request_headers] && env[:request_headers]['X-ForceAuthenticate']
33
+ end
29
34
 
30
35
  end
31
36
 
@@ -1,7 +1,7 @@
1
1
  module Restforce
2
2
 
3
3
  # Authentication middleware used if oauth_token and refresh_token are set
4
- class Middleware::Authentication::OAuth < Restforce::Middleware::Authentication
4
+ class Middleware::Authentication::Token < Restforce::Middleware::Authentication
5
5
 
6
6
  def authenticate!
7
7
  response = connection.post '/services/oauth2/token' do |req|
@@ -1,3 +1,3 @@
1
1
  module Restforce
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/restforce.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'faraday_middleware', '~> 0.8.8'
21
21
  gem.add_dependency 'json', '~> 1.7.5'
22
22
  gem.add_dependency 'hashie', '~> 1.2.0'
23
+ gem.add_dependency 'faye'
23
24
 
24
25
  gem.add_development_dependency 'rspec'
25
26
  gem.add_development_dependency 'webmock'
@@ -1,2 +1 @@
1
- {"id":"foo" +
2
- "","errors":[],"success":true}
1
+ {"id":"foo","errors":[],"success":true}
@@ -46,10 +46,10 @@ shared_examples_for 'methods' do
46
46
  it { should eq Restforce::Middleware::Authentication::Password }
47
47
  end
48
48
 
49
- context 'with oauth token, refresh token, client id and client secret provided' do
49
+ context 'with refresh token, client id and client secret provided' do
50
50
  let(:client_options) { oauth_options }
51
51
 
52
- it { should eq Restforce::Middleware::Authentication::OAuth }
52
+ it { should eq Restforce::Middleware::Authentication::Token }
53
53
  end
54
54
  end
55
55
 
@@ -213,6 +213,48 @@ shared_examples_for 'methods' do
213
213
  end
214
214
  end
215
215
 
216
+ describe '.upsert!' do
217
+ context 'when updated' do
218
+ before do
219
+ @request = stub_api_request 'sobjects/Account/External__c/foobar', method: :patch, body: "{\"Name\":\"Foobar\"}"
220
+ end
221
+
222
+ after do
223
+ @request.should have_been_requested
224
+ end
225
+
226
+ context 'with symbol external Id key' do
227
+ subject { client.upsert!('Account', 'External__c', External__c: 'foobar', Name: 'Foobar') }
228
+ it { should be_true }
229
+ end
230
+
231
+ context 'with string external Id key' do
232
+ subject { client.upsert!('Account', 'External__c', 'External__c' => 'foobar', 'Name' => 'Foobar') }
233
+ it { should be_true }
234
+ end
235
+ end
236
+
237
+ context 'when created' do
238
+ before do
239
+ @request = stub_api_request 'sobjects/Account/External__c/foobar', method: :patch, body: "{\"Name\":\"Foobar\"}", with: 'sobject/upsert_created_success_response'
240
+ end
241
+
242
+ after do
243
+ @request.should have_been_requested
244
+ end
245
+
246
+ context 'with symbol external Id key' do
247
+ subject { client.upsert!('Account', 'External__c', External__c: 'foobar', Name: 'Foobar') }
248
+ it { should eq 'foo' }
249
+ end
250
+
251
+ context 'with string external Id key' do
252
+ subject { client.upsert!('Account', 'External__c', 'External__c' => 'foobar', 'Name' => 'Foobar') }
253
+ it { should eq 'foo' }
254
+ end
255
+ end
256
+ end
257
+
216
258
  describe '.destroy!' do
217
259
  subject { client.destroy!('Account', '001D000000INjVe') }
218
260
 
@@ -268,6 +310,22 @@ shared_examples_for 'methods' do
268
310
  it { should be_true }
269
311
  end
270
312
  end
313
+
314
+ describe '.authenticate!' do
315
+ before do
316
+ @request = stub_request(:post, "https://login.salesforce.com/services/oauth2/token").
317
+ with(:body => "grant_type=password&client_id=client_id&client_secret=" \
318
+ "client_secret&username=foo&password=barsecurity_token").
319
+ to_return(:status => 200, :body => fixture(:auth_success_response))
320
+ end
321
+
322
+ after do
323
+ @request.should have_been_requested
324
+ end
325
+
326
+ subject { client.authenticate! }
327
+ specify { expect { subject }.to_not raise_error }
328
+ end
271
329
  end
272
330
 
273
331
  describe 'with mashify middleware' do
@@ -39,7 +39,7 @@ describe Restforce::Collection do
39
39
 
40
40
  describe '.next_page' do
41
41
  before do
42
- client.should_receive(:get).and_return(Faraday::Response.new(body: Restforce::Collection.new({'records' => {}}, client)))
42
+ client.should_receive(:get).and_return(Faraday::Response.new(body: Restforce::Collection.new({'records' => []}, client)))
43
43
  end
44
44
 
45
45
  subject { records.next_page }
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Restforce::Mash do
4
+ describe '#build' do
5
+ subject { described_class.build(input, nil) }
6
+
7
+ context 'when array' do
8
+ let(:input) { [{ foo: 'hello' }, { bar: 'world' }] }
9
+ it 'mashifys each child object' do
10
+ subject.each { |obj| obj.should be_a Restforce::Mash }
11
+ end
12
+ end
13
+ end
14
+
15
+ describe '#klass' do
16
+ subject { described_class.klass(input) }
17
+
18
+ context 'when the hash has a "records" key' do
19
+ let(:input) { { 'records' => nil } }
20
+ it { should eq Restforce::Collection }
21
+ end
22
+
23
+ context 'when the hash has an "attributes" key' do
24
+ let(:input) { { 'attributes' => nil } }
25
+ it { should eq Restforce::SObject }
26
+ end
27
+
28
+ context 'else' do
29
+ let(:input) { {} }
30
+ it { should eq Restforce::Mash }
31
+ end
32
+ end
33
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Restforce::Middleware::Authentication::OAuth do
3
+ describe Restforce::Middleware::Authentication::Token do
4
4
  let(:app) { double('app') }
5
5
  let(:env) { { } }
6
6
  let(:middleware) { described_class.new app, nil, options }
@@ -64,4 +64,21 @@ describe Restforce::Middleware::Authentication do
64
64
  end
65
65
  end
66
66
  end
67
+
68
+ describe '.force_authenticate?' do
69
+ subject { middleware.force_authenticate?(env) }
70
+
71
+ context 'without X-ForceAuthenticate header set' do
72
+ it { should be_false }
73
+ end
74
+
75
+ context 'with X-ForceAuthenticate header set' do
76
+ before do
77
+ env[:request_headers] = {}
78
+ env[:request_headers]['X-ForceAuthenticate'] = true
79
+ end
80
+
81
+ it { should be_true }
82
+ end
83
+ end
67
84
  end
@@ -22,7 +22,7 @@ shared_context 'basic client' do
22
22
  end
23
23
 
24
24
  let(:oauth_options) do
25
- base_options.merge(:username => nil, :password => nil, :security_token => nil)
25
+ base_options.merge(:username => nil, :password => nil, :security_token => nil, :oauth_token => nil)
26
26
  end
27
27
 
28
28
  let(:password_options) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-06 00:00:00.000000000 Z
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70194283587720 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70194283587720
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: faraday
27
- requirement: &70194283586980 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 0.8.4
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70194283586980
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.8.4
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: faraday_middleware
38
- requirement: &70194283586260 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: 0.8.8
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70194283586260
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.8
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: json
49
- requirement: &70194283585800 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: 1.7.5
55
70
  type: :runtime
56
71
  prerelease: false
57
- version_requirements: *70194283585800
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 1.7.5
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: hashie
60
- requirement: &70194283601640 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,10 +85,31 @@ dependencies:
65
85
  version: 1.2.0
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *70194283601640
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 1.2.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: faye
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
69
110
  - !ruby/object:Gem::Dependency
70
111
  name: rspec
71
- requirement: &70194283601040 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
72
113
  none: false
73
114
  requirements:
74
115
  - - ! '>='
@@ -76,10 +117,15 @@ dependencies:
76
117
  version: '0'
77
118
  type: :development
78
119
  prerelease: false
79
- version_requirements: *70194283601040
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
80
126
  - !ruby/object:Gem::Dependency
81
127
  name: webmock
82
- requirement: &70194283600360 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
83
129
  none: false
84
130
  requirements:
85
131
  - - ! '>='
@@ -87,10 +133,15 @@ dependencies:
87
133
  version: '0'
88
134
  type: :development
89
135
  prerelease: false
90
- version_requirements: *70194283600360
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
91
142
  - !ruby/object:Gem::Dependency
92
143
  name: simplecov
93
- requirement: &70194283599880 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
94
145
  none: false
95
146
  requirements:
96
147
  - - ! '>='
@@ -98,7 +149,12 @@ dependencies:
98
149
  version: '0'
99
150
  type: :development
100
151
  prerelease: false
101
- version_requirements: *70194283599880
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
102
158
  description: A lightweight ruby client for the Salesforce REST api.
103
159
  email:
104
160
  - eric@ejholmes.net
@@ -120,8 +176,8 @@ files:
120
176
  - lib/restforce/mash.rb
121
177
  - lib/restforce/middleware.rb
122
178
  - lib/restforce/middleware/authentication.rb
123
- - lib/restforce/middleware/authentication/oauth.rb
124
179
  - lib/restforce/middleware/authentication/password.rb
180
+ - lib/restforce/middleware/authentication/token.rb
125
181
  - lib/restforce/middleware/authorization.rb
126
182
  - lib/restforce/middleware/instance_url.rb
127
183
  - lib/restforce/middleware/mashify.rb
@@ -165,8 +221,9 @@ files:
165
221
  - spec/lib/client_spec.rb
166
222
  - spec/lib/collection_spec.rb
167
223
  - spec/lib/config_spec.rb
168
- - spec/lib/middleware/authentication/oauth_spec.rb
224
+ - spec/lib/mash_spec.rb
169
225
  - spec/lib/middleware/authentication/password_spec.rb
226
+ - spec/lib/middleware/authentication/token_spec.rb
170
227
  - spec/lib/middleware/authentication_spec.rb
171
228
  - spec/lib/middleware/authorization_spec.rb
172
229
  - spec/lib/middleware/instance_url_spec.rb
@@ -197,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
254
  version: '0'
198
255
  requirements: []
199
256
  rubyforge_project:
200
- rubygems_version: 1.8.11
257
+ rubygems_version: 1.8.23
201
258
  signing_key:
202
259
  specification_version: 3
203
260
  summary: A lightweight ruby client for the Salesforce REST api.
@@ -236,8 +293,9 @@ test_files:
236
293
  - spec/lib/client_spec.rb
237
294
  - spec/lib/collection_spec.rb
238
295
  - spec/lib/config_spec.rb
239
- - spec/lib/middleware/authentication/oauth_spec.rb
296
+ - spec/lib/mash_spec.rb
240
297
  - spec/lib/middleware/authentication/password_spec.rb
298
+ - spec/lib/middleware/authentication/token_spec.rb
241
299
  - spec/lib/middleware/authentication_spec.rb
242
300
  - spec/lib/middleware/authorization_spec.rb
243
301
  - spec/lib/middleware/instance_url_spec.rb