restforce 2.5.1 → 2.5.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/restforce/concerns/connection.rb +4 -4
- data/lib/restforce/config.rb +3 -0
- data/lib/restforce/mash.rb +2 -0
- data/lib/restforce/version.rb +1 -1
- data/spec/unit/concerns/connection_spec.rb +16 -0
- data/spec/unit/config_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fe36ce396f2e18efc3f6ca5baa391ba0d3e5ada
|
4
|
+
data.tar.gz: e968e760eb726434e54576836985732221fd9457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a60bb6adcd71799a5bdbb4b19a41bfefa9aa554db975e3442ee3c90af2db4489a4f699029617dba0f50c5fe2fe2e0ed535160cfb617211cb0054f1cbc0ea165
|
7
|
+
data.tar.gz: 9af84717f844c3497bcc357083e468fcb7fe4c50e070dac0465696bfbea001395335a01d18efdc02c29d1375ccd1af98638f6388ef6cca69d87a98bcca30e53e
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
|
+
## 2.5.2 (Apr 3, 2017)
|
2
|
+
|
3
|
+
* Ensure `Restforce::Middleware::Logger` is the last Faraday middleware to be called so everything is properly logged (including the effects of the `Gzip` and `CustomHeaders` middlewares which were previously running after it) (@jonnymacs)
|
4
|
+
* Suppress [Hashie](https://github.com/intridea/hashie) warnings when using Hashie v3.5.0 or later (see [#295](https://github.com/ejholmes/restforce/pull/295) for details) (@janraasch)
|
5
|
+
|
1
6
|
## 2.5.1 (Mar 16, 2017)
|
2
7
|
|
3
8
|
* Allow setting custom headers, [required by parts of the Salesforce API](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers.htm), by specifiying a `:request_headers` option when instantiating the client (@moskeyombus)
|
4
9
|
* Add support for `upsert`ing using an ID (see the [Salesforce docs](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm) for more details) (@ecbypi)
|
5
10
|
* Relax `faraday` dependency to allow upgrading to Faraday 1.0 (@tinogomes, @alexluke)
|
6
11
|
|
12
|
+
*(This should have been a minor version rather than a patch version, following format MAJOR.MINOR.PATCH, since we use [Semantic Versioning](http://semver.org/) and this adds functionality. Sorry! @timrogers)*
|
13
|
+
|
7
14
|
## 2.5.0 (Dec 7, 2016)
|
8
15
|
|
9
16
|
* __Deprecate support for Ruby 1.9__, since [official support was dropped nearly two years ago](https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/), and it's causing problems with keeping our dependencies up to date
|
data/README.md
CHANGED
@@ -46,14 +46,14 @@ module Restforce
|
|
46
46
|
builder.use Restforce::Middleware::RaiseError
|
47
47
|
# Parses returned JSON response into a hash.
|
48
48
|
builder.response :json, content_type: /\bjson$/
|
49
|
-
# Log request/responses
|
50
|
-
builder.use Restforce::Middleware::Logger,
|
51
|
-
Restforce.configuration.logger,
|
52
|
-
options if Restforce.log?
|
53
49
|
# Compress/Decompress the request/response
|
54
50
|
builder.use Restforce::Middleware::Gzip, self, options
|
55
51
|
# Inject custom headers into requests
|
56
52
|
builder.use Restforce::Middleware::CustomHeaders, self, options
|
53
|
+
# Log request/responses
|
54
|
+
builder.use Restforce::Middleware::Logger,
|
55
|
+
Restforce.configuration.logger,
|
56
|
+
options if Restforce.log?
|
57
57
|
|
58
58
|
builder.adapter adapter
|
59
59
|
end
|
data/lib/restforce/config.rb
CHANGED
@@ -141,6 +141,9 @@ module Restforce
|
|
141
141
|
# Set SSL options
|
142
142
|
option :ssl, default: {}
|
143
143
|
|
144
|
+
# A Hash that is converted to HTTP headers
|
145
|
+
option :request_headers
|
146
|
+
|
144
147
|
# Set a logger for when Restforce.log is set to true, defaulting to STDOUT
|
145
148
|
option :logger, default: ::Logger.new(STDOUT)
|
146
149
|
|
data/lib/restforce/mash.rb
CHANGED
@@ -2,6 +2,8 @@ require 'hashie/mash'
|
|
2
2
|
|
3
3
|
module Restforce
|
4
4
|
class Mash < Hashie::Mash
|
5
|
+
disable_warnings if respond_to?(:disable_warnings)
|
6
|
+
|
5
7
|
class << self
|
6
8
|
# Pass in an Array or Hash and it will be recursively converted into the
|
7
9
|
# appropriate Restforce::Collection, Restforce::SObject and
|
data/lib/restforce/version.rb
CHANGED
@@ -60,6 +60,22 @@ describe Restforce::Concerns::Connection do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
describe ":logger option" do
|
65
|
+
let(:options) { { adapter: Faraday.default_adapter } }
|
66
|
+
|
67
|
+
before(:each) do
|
68
|
+
client.stub(:authentication_middleware)
|
69
|
+
client.stub(:cache)
|
70
|
+
client.stub(options: options)
|
71
|
+
Restforce.stub(log?: true)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "must always be used last before the Faraday Adapter" do
|
75
|
+
client.middleware.handlers.reverse.index(Restforce::Middleware::Logger).
|
76
|
+
should eq 1
|
77
|
+
end
|
78
|
+
end
|
63
79
|
end
|
64
80
|
|
65
81
|
describe '#adapter' do
|
data/spec/unit/config_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe Restforce do
|
|
27
27
|
its(:ssl) { should eq({}) }
|
28
28
|
[:username, :password, :security_token, :client_id, :client_secret,
|
29
29
|
:oauth_token, :refresh_token, :instance_url, :compress, :timeout,
|
30
|
-
:proxy_uri, :authentication_callback, :mashify].each do |attr|
|
30
|
+
:proxy_uri, :authentication_callback, :mashify, :request_headers].each do |attr|
|
31
31
|
its(attr) { should be_nil }
|
32
32
|
end
|
33
33
|
end
|
@@ -59,8 +59,8 @@ describe Restforce do
|
|
59
59
|
describe '#configure' do
|
60
60
|
[:username, :password, :security_token, :client_id, :client_secret, :compress,
|
61
61
|
:timeout, :oauth_token, :refresh_token, :instance_url, :api_version, :host, :mashify,
|
62
|
-
:authentication_retries, :proxy_uri, :authentication_callback, :ssl,
|
63
|
-
:logger].each do |attr|
|
62
|
+
:authentication_retries, :proxy_uri, :authentication_callback, :ssl,
|
63
|
+
:request_headers, :log_level, :logger].each do |attr|
|
64
64
|
it "allows #{attr} to be set" do
|
65
65
|
Restforce.configure do |config|
|
66
66
|
config.send("#{attr}=", 'foobar')
|
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: 2.5.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric J. Holmes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-03
|
12
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|