restforce 7.3.0 → 7.4.0

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: bf5c1ca9f3040291c2e30d35f51d3be42e8d6cd2e73bc5e5ea108fddd015066a
4
+ data.tar.gz: fda0b60d481bb9200a2b682f282796d44f636ac07b5c4929e3e360e76c6a500e
5
5
  SHA512:
6
- metadata.gz: 62fdf7157d265d3d8af5b37ecec52a98f1462a1dcc62e72471b2ddb29380821a90b0e38cb5cd111dc4b925182af169bda56f131e0798277e1f2c55f1132ec5d8
7
- data.tar.gz: a62df632fca2528e5dd991dbf4ab95f5cb7cc201819dbfeed5dfb4d021bdf47b567a10eda7ed9cc2e7436acbf89951cd7f85e0d57bd421438a7b9870aa2ed8fb
6
+ metadata.gz: 23235274ac40e162128bd2dc86d4da182129e9b406e665241978aa7affce65ac656a7502ace2c94d14120a3c421debb2b7bbdf3919764a543cbc5a2570b16de2
7
+ data.tar.gz: 86fd5160d648437fb041bb914401c98f942b20fec3c2badc952a5915c55fbffcd6b94ba8a170a6925827744a3003b7552005629575b57df933115fa2f7e75625
@@ -10,7 +10,7 @@ jobs:
10
10
  # For v2.0.x, we test v2.0.0 and v2.0.1 because v2.0.0 has a special behaviour where
11
11
  # the Net::HTTP adapter is not included. See
12
12
  # https://github.com/lostisland/faraday/blob/main/UPGRADING.md#faraday-20.
13
- faraday_version: ['1.1.0', '1.2.0', '1.3.1', '1.4.3', '1.5.1', '1.6.0', '1.7.2', '1.8.0', '1.9.3', '1.10.3', '2.0.0', '2.0.1', '2.1.0', '2.2.0', '2.3.0', '2.4.0', '2.5.2', '2.6.0', '2.7.12', '2.8.1', '2.9.0']
13
+ faraday_version: ['1.1.0', '1.2.0', '1.3.1', '1.4.3', '1.5.1', '1.6.0', '1.7.2', '1.8.0', '1.9.3', '1.10.3', '2.0.0', '2.0.1', '2.1.0', '2.2.0', '2.3.0', '2.4.0', '2.5.2', '2.6.0', '2.7.12', '2.8.1', '2.9.2', '2.10.0']
14
14
  env:
15
15
  FARADAY_VERSION: ~> ${{ matrix.faraday_version }}
16
16
  steps:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 7.4.0 (July 10, 2024)
2
+
3
+ - Add support for `faraday` v2.10.x (@ryan-mcneil)
4
+
5
+ # 7.3.1 (Mar 30, 2024)
6
+
7
+ - Fix `uninitialized constant StringIO` error by explicitly requiring `StringIO` where it's used (@timrogers)
8
+
1
9
  # 7.3.0 (Feb 14, 2024 🧡)
2
10
 
3
11
  - Add support for making `GET` requests using the Composite API (@shravan097)
data/Gemfile CHANGED
@@ -3,7 +3,7 @@
3
3
  source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
- faraday_version = ENV.fetch('FARADAY_VERSION', '~> 2.9.0')
6
+ faraday_version = ENV.fetch('FARADAY_VERSION', '~> 2.10.0')
7
7
 
8
8
  # Enable us to explicitly pick a Faraday version when running tests
9
9
  gem 'faraday', faraday_version
@@ -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.65.0'
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.4.0'
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.
@@ -666,7 +666,7 @@ module Restforce
666
666
  "defined. If you're sure that this is a valid Salesforce error, then " \
667
667
  "please create an issue on GitHub at <#{GITHUB_ISSUE_URL}>."
668
668
 
669
- super(constant_name)
669
+ super
670
670
  end
671
671
  end
672
672
  end
@@ -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.4.0'
5
5
  end
data/restforce.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |gem|
24
24
 
25
25
  gem.required_ruby_version = '>= 3.0'
26
26
 
27
- gem.add_dependency 'faraday', '< 2.10.0', '>= 1.1.0'
27
+ gem.add_dependency 'faraday', '< 2.11.0', '>= 1.1.0'
28
28
  gem.add_dependency 'faraday-follow_redirects', '<= 0.3.0', '< 1.0.0'
29
29
  gem.add_dependency 'faraday-multipart', '>= 1.0.0', '< 2.0.0'
30
30
  gem.add_dependency 'faraday-net_http', '< 4.0.0'
@@ -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.4.0
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-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - "<"
19
19
  - !ruby/object:Gem::Version
20
- version: 2.10.0
20
+ version: 2.11.0
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.1.0
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - "<"
29
29
  - !ruby/object:Gem::Version
30
- version: 2.10.0
30
+ version: 2.11.0
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.1.0