restforce 7.5.0 → 8.0.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: 9489f9967f5db3f3ed0416764939fbc2c2c684d7b2710c9d1e23bbe058cc135f
4
- data.tar.gz: 588949562f3af9fab7d56d9dfb40e48a7e7f449cab4b21c0cf8a3f5f153fa0f9
3
+ metadata.gz: 4ca784cfed06e62e6d2fc0deb0ab93dd9fb626bb0452acc57862cc8955fd20a2
4
+ data.tar.gz: 326f27b8e2e63639c5c086d99a2434b1fefaed7494285e56b15f4e74d680eb28
5
5
  SHA512:
6
- metadata.gz: 8149c2d06c96bc909ef1e05fb6ce94e1baeea771b5e45ad349ddbb3cda6ef2731f0450b708de6928ef1b155b60cdca161e75d332306b2256f94e82a86cd752a1
7
- data.tar.gz: 554c351180e0c614dc1323d07a25252e54acb9bc37c01e270b9df1d74d44df1996abb0a3a2a70e277935ea053798a7262c2512a743d24ab027639569a871954c
6
+ metadata.gz: 392d765b3a14c1dc0f28a7c5d46e00bc699d1dabf433a757fdda00e3422e4bb4f10afc9f9332b5b34c5a928ad24c0924d7c961135a13d1e1e15e63a2d56af348
7
+ data.tar.gz: 7c0508ec94f48747bcb0d6a9544d2a9283730f6676a11bfecf71ecf76539d854992dbd85b52ca30a19fb2b89520d095c721de64d841bb50f7a7409329c66ab7d
@@ -6,7 +6,7 @@ jobs:
6
6
  strategy:
7
7
  fail-fast: false
8
8
  matrix:
9
- ruby_version: ['3.0', '3.1', '3.2', '3.3']
9
+ ruby_version: ["3.1", "3.2", "3.3", "3.4.0-rc1"]
10
10
  steps:
11
11
  - name: Checkout code
12
12
  uses: actions/checkout@v4
@@ -10,7 +10,33 @@ 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.2', '2.10.1', '2.11.0']
13
+ faraday_version:
14
+ [
15
+ "1.1.0",
16
+ "1.2.0",
17
+ "1.3.1",
18
+ "1.4.3",
19
+ "1.5.1",
20
+ "1.6.0",
21
+ "1.7.2",
22
+ "1.8.0",
23
+ "1.9.3",
24
+ "1.10.3",
25
+ "2.0.0",
26
+ "2.0.1",
27
+ "2.1.0",
28
+ "2.2.0",
29
+ "2.3.0",
30
+ "2.4.0",
31
+ "2.5.2",
32
+ "2.6.0",
33
+ "2.7.12",
34
+ "2.8.1",
35
+ "2.9.2",
36
+ "2.10.1",
37
+ "2.11.0",
38
+ "2.12.2",
39
+ ]
14
40
  env:
15
41
  FARADAY_VERSION: ~> ${{ matrix.faraday_version }}
16
42
  steps:
data/.rubocop.yml CHANGED
@@ -8,7 +8,7 @@ AllCops:
8
8
  - .*/**/*
9
9
  - vendor/**/*
10
10
  NewCops: enable
11
- TargetRubyVersion: 3.0
11
+ TargetRubyVersion: 3.1
12
12
 
13
13
  # Limit lines to 90 characters.
14
14
  Layout/LineLength:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 8.0.0 (December 18, 2024)
2
+
3
+ **This version contains breaking changes. For help with upgrading, see [`UPGRADING.md`](https://github.com/restforce/restforce/blob/main/UPGRADING.md).**
4
+
5
+ - **⚠️ Drop support for Ruby 3.0**, since Ruby 3.0 has reached its end-of-life (@timrogers)
6
+
7
+ ## 7.6.0 (December 18, 2024)
8
+
9
+ - **Allow all `faraday` versions up to, but not including, v3.0.0**: For more details, see https://github.com/restforce/restforce/pull/915 (@timrogers)
10
+
1
11
  ## 7.5.0 (September 4, 2024)
2
12
 
3
13
  - Add support for `faraday` v2.11.x (@timrogers)
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.11.0')
6
+ faraday_version = ENV.fetch('FARADAY_VERSION', '~> 2.12.2')
7
7
 
8
8
  # Enable us to explicitly pick a Faraday version when running tests
9
9
  gem 'faraday', faraday_version
@@ -15,8 +15,8 @@ gem 'jruby-openssl', platforms: :jruby
15
15
  gem 'rake'
16
16
  gem 'rspec', '~> 3.13.0'
17
17
  gem 'rspec-collection_matchers', '~> 1.2.0'
18
- gem 'rspec-its', '~> 1.3.0'
18
+ gem 'rspec-its', '~> 2.0.0'
19
19
  gem 'rspec_junit_formatter', '~> 0.6.0'
20
- gem 'rubocop', '~> 1.66.0'
20
+ gem 'rubocop', '~> 1.69.2'
21
21
  gem 'simplecov', '~> 0.22.0'
22
- gem 'webmock', '~> 3.23.0'
22
+ gem 'webmock', '~> 3.24.0'
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![CircleCI](https://circleci.com/gh/restforce/restforce.svg?style=svg)](https://circleci.com/gh/restforce/restforce)
4
4
  ![Downloads](https://img.shields.io/gem/dt/restforce.svg)
5
5
 
6
- Restforce is a ruby gem for the [Salesforce REST api](http://www.salesforce.com/us/developer/docs/api_rest/index.htm).
6
+ Restforce is a ruby gem for the [Salesforce REST API](http://www.salesforce.com/us/developer/docs/api_rest/index.htm).
7
7
 
8
8
  Features include:
9
9
 
@@ -27,7 +27,7 @@ Features include:
27
27
 
28
28
  Add this line to your application's Gemfile:
29
29
 
30
- gem 'restforce', '~> 7.5.0'
30
+ gem 'restforce', '~> 8.0.0'
31
31
 
32
32
  And then execute:
33
33
 
@@ -37,15 +37,16 @@ Or install it yourself as:
37
37
 
38
38
  $ gem install restforce
39
39
 
40
- __As of version 7.0.0, this gem is only compatible with Ruby 3.0.0 and later.__ If you're using an earlier Ruby version:
40
+ **As of version 8.0.0, this gem is only compatible with Ruby 3.1.0 and later.** If you're using an earlier Ruby version:
41
41
 
42
- * for Ruby 2.7, use version 6.2.4 or earlier
43
- * for Ruby 2.6, use version 5.3.1 or earlier
44
- * for Ruby 2.5, use version 5.0.6 or earlier
45
- * for Ruby 2.4, use version 4.3.0 or earlier
46
- * for Ruby 2.3, use version 3.2.0 or earlier
47
- * for Ruby versions 2.2, 2.1 and 2.0, use version 2.5.3 or earlier
48
- * for Ruby 1.9.3, use version 2.4.2
42
+ - for Ruby 3.0, use version 7.6.0 or earlier
43
+ - for Ruby 2.7, use version 6.2.4 or earlier
44
+ - for Ruby 2.6, use version 5.3.1 or earlier
45
+ - for Ruby 2.5, use version 5.0.6 or earlier
46
+ - for Ruby 2.4, use version 4.3.0 or earlier
47
+ - for Ruby 2.3, use version 3.2.0 or earlier
48
+ - for Ruby versions 2.2, 2.1 and 2.0, use version 2.5.3 or earlier
49
+ - for Ruby 1.9.3, use version 2.4.2
49
50
 
50
51
  This gem is versioned using [Semantic Versioning](http://semver.org/), so you can be confident when updating that there will not be breaking changes outside of a major version (following format MAJOR.MINOR.PATCH, so for instance moving from 3.1.0 to 4.0.0 would be allowed to include incompatible API changes). See the [changelog](https://github.com/restforce/restforce/tree/master/CHANGELOG.md) for details on what has changed in each version.
51
52
 
@@ -116,7 +117,7 @@ If you prefer to use a username and password to authenticate:
116
117
  client = Restforce.new(username: config['username'],
117
118
  password: config['password'],
118
119
  instance_url: config['instance_url'],
119
- host: config['host'], # https://test.salesforce.com for sandbox (optional)
120
+ host: config['host'], # test.salesforce.com for sandbox (optional)
120
121
  client_id: config['client_key'], # Salesforce Client Key
121
122
  client_secret: config['client_secret'], # Salesforce Client Secret
122
123
  api_version: '55.0')
@@ -329,7 +330,7 @@ client.search('FIND {bar}')
329
330
  # => #<Restforce::Collection >
330
331
 
331
332
  # Find accounts matching the term 'genepoint' and return the `Name` field
332
- client.search('FIND {genepoint} RETURNING Account (Name)').map(&:Name)
333
+ client.search('FIND {genepoint} RETURNING Account (Name)')["searchRecords"].map(&:Name)
333
334
  # => ['GenePoint']
334
335
  ```
335
336
 
data/UPGRADING.md CHANGED
@@ -1,3 +1,15 @@
1
+ # Upgrading from Restforce 7.x to 8.x
2
+
3
+ ## Ruby 3.0 is no longer supported
4
+
5
+ **Likelyhood of impact**: Moderate
6
+
7
+ Ruby 3.0 is no longer officially supported as an active version of the Ruby language. That means that it will not receive patches and security fixes.
8
+
9
+ Accordingly, we've dropped support for Ruby 3.0 in the Restforce library. The gemspec now specifies that only 3.1 onwards is supported, and this will be enforced by RubyGems.
10
+
11
+ Before you update to Restforce 8.x, you'll need to switch to Ruby 3.1.0 or later. The current version of Ruby at the time of writing is 3.3.6.
12
+
1
13
  # Upgrading from Restforce 6.x to 7.x
2
14
 
3
15
  ## Ruby 2.7 is no longer supported
@@ -12,12 +12,12 @@ module Restforce
12
12
  end
13
13
 
14
14
  # Yield each value on each page.
15
- def each(&block)
15
+ def each(&)
16
16
  @raw_page['records'].each { |record| yield Restforce::Mash.build(record, @client) }
17
17
 
18
18
  np = next_page
19
19
  while np
20
- np.current_page.each(&block)
20
+ np.current_page.each(&)
21
21
  np = np.next_page
22
22
  end
23
23
  end
@@ -29,8 +29,8 @@ module Restforce
29
29
  end.flatten
30
30
  end
31
31
 
32
- def batch!(&block)
33
- batch(halt_on_error: true, &block)
32
+ def batch!(&)
33
+ batch(halt_on_error: true, &)
34
34
  end
35
35
 
36
36
  class Subrequests
@@ -85,7 +85,7 @@ module Restforce
85
85
  def valid?(picklist_entry)
86
86
  valid_for = picklist_entry['validFor'].ljust(16, 'A').unpack1('m').
87
87
  unpack('C*')
88
- (valid_for[index >> 3] & (0x80 >> (index % 8))).positive?
88
+ valid_for[index >> 3].anybits?((0x80 >> (index % 8)))
89
89
  end
90
90
  end
91
91
  end
@@ -9,9 +9,9 @@ module Restforce
9
9
  # block - A block to run when a new message is received.
10
10
  #
11
11
  # Returns a Faye::Subscription
12
- def legacy_subscribe(topics, options = {}, &block)
12
+ def legacy_subscribe(topics, options = {}, &)
13
13
  topics = Array(topics).map { |channel| "/topic/#{channel}" }
14
- subscription(topics, options, &block)
14
+ subscription(topics, options, &)
15
15
  end
16
16
  alias subscribe legacy_subscribe
17
17
 
@@ -21,12 +21,12 @@ module Restforce
21
21
  # block - A block to run when a new message is received.
22
22
  #
23
23
  # Returns a Faye::Subscription
24
- def subscription(channels, options = {}, &block)
24
+ def subscription(channels, options = {}, &)
25
25
  one_or_more_channels = Array(channels)
26
26
  one_or_more_channels.each do |channel|
27
27
  replay_handlers[channel] = options[:replay]
28
28
  end
29
- faye.subscribe(one_or_more_channels, &block)
29
+ faye.subscribe(one_or_more_channels, &)
30
30
  end
31
31
 
32
32
  # Public: Faye client to use for subscribing to PushTopics
@@ -46,10 +46,10 @@ module Restforce
46
46
  end
47
47
  end
48
48
 
49
- def initialize(source_hash = nil, client = nil, default = nil, &blk)
49
+ def initialize(source_hash = nil, client = nil, default = nil, &)
50
50
  @client = client
51
51
  deep_update(source_hash) if source_hash
52
- default ? super(default) : super(&blk)
52
+ default ? super(default) : super(&)
53
53
  end
54
54
 
55
55
  def dup
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Restforce
4
- VERSION = '7.5.0'
4
+ VERSION = '8.0.0'
5
5
  end
data/restforce.gemspec CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |gem|
22
22
  'rubygems_mfa_required' => 'true'
23
23
  }
24
24
 
25
- gem.required_ruby_version = '>= 3.0'
25
+ gem.required_ruby_version = '>= 3.1'
26
26
 
27
- gem.add_dependency 'faraday', '< 2.12.0', '>= 1.1.0'
27
+ gem.add_dependency 'faraday', '< 3.0.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'
@@ -85,6 +85,8 @@ describe Restforce::Concerns::Connection do
85
85
  client.stub options: { adapter: :typhoeus }
86
86
  end
87
87
 
88
- its(:adapter) { should eq(:typhoeus) }
88
+ it "uses typheous adapter" do
89
+ expect(client.send(:adapter)).to be(:typhoeus)
90
+ end
89
91
  end
90
92
  end
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.5.0
4
+ version: 8.0.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-09-04 00:00:00.000000000 Z
12
+ date: 2024-12-18 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.12.0
20
+ version: 3.0.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.12.0
30
+ version: 3.0.0
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.1.0
@@ -288,14 +288,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
288
  requirements:
289
289
  - - ">="
290
290
  - !ruby/object:Gem::Version
291
- version: '3.0'
291
+ version: '3.1'
292
292
  required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  requirements:
294
294
  - - ">="
295
295
  - !ruby/object:Gem::Version
296
296
  version: '0'
297
297
  requirements: []
298
- rubygems_version: 3.5.3
298
+ rubygems_version: 3.5.16
299
299
  signing_key:
300
300
  specification_version: 4
301
301
  summary: A lightweight Ruby client for the Salesforce REST API