restforce 7.3.0 → 7.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6654e481c857ecb9ac254b03727287038371662899d1ef0a136c49c1cd5e86d6
4
- data.tar.gz: 5a78a982b7bc65c3332320682d44bc7f2a46a234b9afc5360bca79fa0c8eddeb
3
+ metadata.gz: f34ecbdf8bef8fa7068bef79572000b9766bd9c3be35f8aebe87f43630180910
4
+ data.tar.gz: 8644247ec7b8201da773efef8d87084b2e91f864fe307eb7d9d0de681c4acc21
5
5
  SHA512:
6
- metadata.gz: 62fdf7157d265d3d8af5b37ecec52a98f1462a1dcc62e72471b2ddb29380821a90b0e38cb5cd111dc4b925182af169bda56f131e0798277e1f2c55f1132ec5d8
7
- data.tar.gz: a62df632fca2528e5dd991dbf4ab95f5cb7cc201819dbfeed5dfb4d021bdf47b567a10eda7ed9cc2e7436acbf89951cd7f85e0d57bd421438a7b9870aa2ed8fb
6
+ metadata.gz: df91e270270256472f9a56a384ddf3884d18cdc227910a08132ed6bed8e26063460a7702a0211ea04e93392ffeffaf655211083edfb9013839e63f9ab1eacaf3
7
+ data.tar.gz: d348b9e29964e071883c40158da5f97a10766b05dc093309f71338ec72f01def17238fc9a65ad3014088cf45a5d7f5e72b11a9ec8d9ad0c446947650ce783c62
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 7.3.1 (Mar 30, 2024)
2
+
3
+ - Fix `uninitialized constant StringIO` error by explicitly requiring `StringIO` where it's used (@timrogers)
4
+
1
5
  # 7.3.0 (Feb 14, 2024 🧡)
2
6
 
3
7
  - Add support for making `GET` requests using the Composite API (@shravan097)
data/Gemfile CHANGED
@@ -17,6 +17,6 @@ gem 'rspec', '~> 3.13.0'
17
17
  gem 'rspec-collection_matchers', '~> 1.2.0'
18
18
  gem 'rspec-its', '~> 1.3.0'
19
19
  gem 'rspec_junit_formatter', '~> 0.6.0'
20
- gem 'rubocop', '~> 1.60.1'
20
+ gem 'rubocop', '~> 1.62.1'
21
21
  gem 'simplecov', '~> 0.22.0'
22
- gem 'webmock', '~> 3.20.0'
22
+ gem 'webmock', '~> 3.23.0'
data/README.md CHANGED
@@ -27,7 +27,7 @@ Features include:
27
27
 
28
28
  Add this line to your application's Gemfile:
29
29
 
30
- gem 'restforce', '~> 7.3.0'
30
+ gem 'restforce', '~> 7.3.1'
31
31
 
32
32
  And then execute:
33
33
 
@@ -155,7 +155,7 @@ client = Restforce.new
155
155
 
156
156
  **Note:** Restforce library does not cache JWT Bearer tokens automatically. This means that every instantiation of the Restforce class will be treated as a new login by Salesforce. Remember that Salesforce enforces [rate limits on login requests](https://help.salesforce.com/s/articleView?id=000312767&type=1). If you are building an application that will instantiate the Restforce class more than this specified rate limit, you might want to consider caching the Bearer token either in-memory or in your own storage by leveraging the `authentication_callback` method.
157
157
 
158
- ## Client Credentials
158
+ #### Client Credentials
159
159
 
160
160
  If you want to authenticate as an application, you can use the [Client Credentials flow](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_client_credentials_flow.htm&type=5):
161
161
 
@@ -163,7 +163,7 @@ If you want to authenticate as an application, you can use the [Client Credentia
163
163
  client = Restforce.new(client_id: 'client_id',
164
164
  client_secret: 'client_secret',
165
165
  api_version: '55.0',
166
- instance_url: 'instance_url')
166
+ host: 'MYDOMAIN.my.salesforce.com')
167
167
  ```
168
168
 
169
169
  #### Sandbox Organizations
@@ -842,6 +842,18 @@ client.create!("CustomField", {
842
842
  })
843
843
  ```
844
844
 
845
+ ## Configuration Precedence
846
+
847
+ Here's the order of precedence from highest to lowest:
848
+
849
+ Arguments on new: passing configuration options directly as arguments has the highest precedence. These settings will override any other configuration.
850
+
851
+ Configuration block: using Restforce.configure to set configuration options is the next in line. They will take precedence over environment variables and defaults but will be overridden by direct arguments on instantiation.
852
+
853
+ Environment variables: has the lowest precedence. If you set options using environment variables, they will be overridden by any other configuration method.
854
+
855
+ Defaults: If none of the above methods are used, Restforce falls back to its default configuration values.
856
+
845
857
  ## Contributing
846
858
 
847
859
  We welcome all contributions - they help us make Restforce the best gem possible.
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'stringio'
3
4
  require 'zlib'
4
5
 
5
6
  module Restforce
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'stringio'
4
+
3
5
  module Faraday
4
6
  module Parts
5
7
  module Part
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Restforce
4
- VERSION = '7.3.0'
4
+ VERSION = '7.3.1'
5
5
  end
@@ -70,6 +70,21 @@ describe Restforce do
70
70
  expect(Restforce.configuration.send(attr)).to eq 'foobar'
71
71
  end
72
72
  end
73
+
74
+ it 'takes precedence over environment variables' do
75
+ { 'SALESFORCE_USERNAME' => 'env_foo',
76
+ 'SALESFORCE_CLIENT_ID' => 'env_client id' }.
77
+ each { |var, value| ENV.stub(:fetch).with(var, anything).and_return(value) }
78
+
79
+ { username: 'config_foo', client_id: nil }.each do |attr, value|
80
+ Restforce.configure do |config|
81
+ config.send("#{attr}=", value)
82
+ end
83
+ end
84
+
85
+ expect(Restforce.configuration.send(:username)).to eq 'config_foo'
86
+ expect(Restforce.configuration.send(:client_id)).to eq 'env_client id'
87
+ end
73
88
  end
74
89
 
75
90
  describe '#log?' do
@@ -138,5 +153,17 @@ describe Restforce do
138
153
  checker.check!
139
154
  end
140
155
  end
156
+
157
+ it 'shows the precedence over config' do
158
+ ENV['SALESFORCE_USERNAME'] = 'env_foo'
159
+ Restforce.configure do |config|
160
+ config.username = 'config_foo'
161
+ end
162
+ client = Restforce.new(username: 'foo')
163
+
164
+ expect(client.options[:username]).to eq 'foo'
165
+
166
+ Restforce.instance_variable_set :@configuration, nil
167
+ end
141
168
  end
142
169
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'stringio'
4
+
3
5
  require 'spec_helper'
4
6
 
5
7
  describe Restforce::Middleware::Gzip 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: 7.3.0
4
+ version: 7.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Rogers
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-02-14 00:00:00.000000000 Z
12
+ date: 2024-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday