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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a2edec8fbe80bbf028b896e38efbe598ce91ba9
4
- data.tar.gz: 567b7ede645cc03d358320ac85898efd106f9415
3
+ metadata.gz: 2fe36ce396f2e18efc3f6ca5baa391ba0d3e5ada
4
+ data.tar.gz: e968e760eb726434e54576836985732221fd9457
5
5
  SHA512:
6
- metadata.gz: 902362f2c9cc5c24d70c945873f3afc182b1225925cb7d2dd8d5419a1b5ba02d4fc3f1f833813981118620c33994a843bf3c244e4dc42546c85fb85d79896861
7
- data.tar.gz: 42a7923a9ae9e2e8c9d2928b746fe2832b5f40ed0a81882aed777cf8cd0e8fee91fc76f8e42f1e7e9212b1d9a280c5d3411535409b5a81e431b8b219e65bc982
6
+ metadata.gz: 3a60bb6adcd71799a5bdbb4b19a41bfefa9aa554db975e3442ee3c90af2db4489a4f699029617dba0f50c5fe2fe2e0ed535160cfb617211cb0054f1cbc0ea165
7
+ data.tar.gz: 9af84717f844c3497bcc357083e468fcb7fe4c50e070dac0465696bfbea001395335a01d18efdc02c29d1375ccd1af98638f6388ef6cca69d87a98bcca30e53e
@@ -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
@@ -25,7 +25,7 @@ Features include:
25
25
 
26
26
  Add this line to your application's Gemfile:
27
27
 
28
- gem 'restforce', '~> 2.5.1'
28
+ gem 'restforce', '~> 2.5.2'
29
29
 
30
30
  And then execute:
31
31
 
@@ -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
@@ -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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Restforce
2
- VERSION = '2.5.1'
2
+ VERSION = '2.5.2'.freeze
3
3
  end
@@ -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
@@ -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, :log_level,
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.1
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-16 00:00:00.000000000 Z
12
+ date: 2017-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday