restforce 5.0.1 → 5.0.2

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: 30927d4c4482b918c5d7bce04db72c65a26dfeb6671c637310271beeead93efc
4
- data.tar.gz: 6a3925cad38fcd9b17ed7989be9a18c9e371647d84f514b99acda6c3d3af3735
3
+ metadata.gz: 6b5b0552d40edc08c24070cfcd8b34b359e8240a2121dd5cb4e50e15bd99b873
4
+ data.tar.gz: 85b8a63c6e37474344d266c11d578ba7a2f0d9fdc11afcb1275a76eb29e5e2b4
5
5
  SHA512:
6
- metadata.gz: e06ff037a4b28de59bbe136f4bf8498057069d295f3a0b61bbc2f4cee1014fe76eaa6c1877fdafc731a19712e00c3205049da0f87229bab2111a67f0fb3894cc
7
- data.tar.gz: 9c96d213af65c81cf0f89f3583bf7faa7f39a3c71193b7412c836d80ce19149766dce3a966a00fa8cd067f773249a58a58dcfbf4b051b32d55bd30da22b9fd07
6
+ metadata.gz: 493fe598b73948b072723a4d9f158aaa62191cb7556c40a36952a75b26a9fe128f2ae0c0cdef29720bde0f47dcfe1515e7149379d3c0d924f7f86d9fa4d5569f
7
+ data.tar.gz: 253579496be482255d6b384035c9394f2f122262b482472e45f30590be3d760975e9490eafea2531ad56c9bf1fa7a23b28a6fd21e9dbf5a5828482bf1a26037c
@@ -1,3 +1,9 @@
1
+ ## 5.0.2 (Sep 6, 2020)
2
+
3
+ * Handle the undocumented `REQUEST_LIMIT_EXCEEDED` error returned by Salesforce (@wkirkby, @timrogers)
4
+ * Handle the undocumented `SERVER_UNAVAILABLE` error returned by Salesforce (@wkirkby, @timrogers)
5
+ * Refactor the library to be compatible with Rubocop 0.90's cops (this shouldn't introduce any noticeable changes see #569 for detailed changes) (@timrogers)
6
+
1
7
  ## 5.0.1 (Aug 13, 2020)
2
8
 
3
9
  * Handle the undocumented `API_CURRENTLY_DISABLED` error returned by Salesforce (@ruipserra, @timrogers)
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', '~> 5.0.1'
28
+ gem 'restforce', '~> 5.0.2'
29
29
 
30
30
  And then execute:
31
31
 
@@ -12,12 +12,12 @@ module Restforce
12
12
  end
13
13
 
14
14
  # Yield each value on each page.
15
- def each
15
+ def each(&block)
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 { |record| yield record }
20
+ np.current_page.each(&block)
21
21
  np = np.next_page
22
22
  end
23
23
  end
@@ -35,7 +35,7 @@ module Restforce
35
35
  @valid_for = options.delete(:valid_for)
36
36
  raise "#{field} is not a dependent picklist" if @valid_for && !dependent?
37
37
 
38
- replace(picklist_values)
38
+ super(picklist_values)
39
39
  end
40
40
 
41
41
  private
@@ -151,7 +151,7 @@ module Restforce
151
151
  option :request_headers
152
152
 
153
153
  # Set a logger for when Restforce.log is set to true, defaulting to STDOUT
154
- option :logger, default: ::Logger.new(STDOUT)
154
+ option :logger, default: ::Logger.new($stdout)
155
155
 
156
156
  # Set a log level for logging when Restforce.log is set to true, defaulting to :debug
157
157
  option :log_level, default: :debug
@@ -167,9 +167,11 @@ module Restforce
167
167
  class PortalUserAlreadyExistsForContact < ResponseError; end
168
168
  class PrivateContactOnAsset < ResponseError; end
169
169
  class RecordInUseByWorkflow < ResponseError; end
170
+ class RequestLimitExceeded < ResponseError; end
170
171
  class RequestRunningTooLong < ResponseError; end
171
172
  class RequiredFieldMissing < ResponseError; end
172
173
  class SelfReferenceFromTrigger < ResponseError; end
174
+ class ServerUnavailable < ResponseError; end
173
175
  class ShareNeededForChildOwner < ResponseError; end
174
176
  class SingleEmailLimitExceeded < ResponseError; end
175
177
  class StandardPriceNotDefined < ResponseError; end
@@ -359,9 +361,11 @@ module Restforce
359
361
  "PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT" => PortalUserAlreadyExistsForContact,
360
362
  "PRIVATE_CONTACT_ON_ASSET" => PrivateContactOnAsset,
361
363
  "RECORD_IN_USE_BY_WORKFLOW" => RecordInUseByWorkflow,
364
+ "REQUEST_LIMIT_EXCEEDED" => RequestLimitExceeded,
362
365
  "REQUEST_RUNNING_TOO_LONG" => RequestRunningTooLong,
363
366
  "REQUIRED_FIELD_MISSING" => RequiredFieldMissing,
364
367
  "SELF_REFERENCE_FROM_TRIGGER" => SelfReferenceFromTrigger,
368
+ "SERVER_UNAVAILABLE" => ServerUnavailable,
365
369
  "SHARE_NEEDED_FOR_CHILD_OWNER" => ShareNeededForChildOwner,
366
370
  "SINGLE_EMAIL_LIMIT_EXCEEDED" => SingleEmailLimitExceeded,
367
371
  "STANDARD_PRICE_NOT_DEFINED" => StandardPriceNotDefined,
@@ -11,9 +11,10 @@ module Restforce
11
11
  # appropriate Restforce::Collection, Restforce::SObject and
12
12
  # Restforce::Mash objects.
13
13
  def build(val, client)
14
- if val.is_a?(Array)
14
+ case val
15
+ when Array
15
16
  val.collect { |a_val| self.build(a_val, client) }
16
- elsif val.is_a?(Hash)
17
+ when Hash
17
18
  self.klass(val).new(val, client)
18
19
  else
19
20
  val
@@ -55,6 +56,9 @@ module Restforce
55
56
  self.class.new(self, @client, self.default)
56
57
  end
57
58
 
59
+ # The #convert_value method and its signature are part of Hashie::Mash's API, so we
60
+ # can't unilaterally decide to change `duping` to be a keyword argument
61
+ # rubocop:disable Style/OptionalBooleanParameter
58
62
  def convert_value(val, duping = false)
59
63
  case val
60
64
  when self.class
@@ -68,5 +72,6 @@ module Restforce
68
72
  val
69
73
  end
70
74
  end
75
+ # rubocop:enable Style/OptionalBooleanParameter
71
76
  end
72
77
  end
@@ -16,6 +16,8 @@ module Restforce
16
16
  autoload :CustomHeaders, 'restforce/middleware/custom_headers'
17
17
 
18
18
  def initialize(app, client, options)
19
+ super(app)
20
+
19
21
  @app = app
20
22
  @client = client
21
23
  @options = options
@@ -11,7 +11,7 @@ module Restforce
11
11
  @options = options
12
12
  @logger = logger || begin
13
13
  require 'logger'
14
- ::Logger.new(STDOUT)
14
+ ::Logger.new($stdout)
15
15
  end
16
16
  end
17
17
 
@@ -36,7 +36,8 @@ module Restforce
36
36
  end
37
37
 
38
38
  def dump(hash)
39
- "\n" + hash.map { |k, v| " #{k}: #{v.inspect}" }.join("\n")
39
+ dumped_pairs = hash.map { |k, v| " #{k}: #{v.inspect}" }.join("\n")
40
+ "\n#{dumped_pairs}"
40
41
  end
41
42
  end
42
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Restforce
4
- VERSION = '5.0.1'
4
+ VERSION = '5.0.2'
5
5
  end
@@ -34,7 +34,7 @@ Gem::Specification.new do |gem|
34
34
  gem.add_development_dependency 'faye' unless RUBY_PLATFORM == 'java'
35
35
  gem.add_development_dependency 'rspec', '~> 2.14.0'
36
36
  gem.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
37
- gem.add_development_dependency 'rubocop', '~> 0.87.1'
38
- gem.add_development_dependency 'simplecov', '~> 0.18.2'
37
+ gem.add_development_dependency 'rubocop', '~> 0.90.0'
38
+ gem.add_development_dependency 'simplecov', '~> 0.19.0'
39
39
  gem.add_development_dependency 'webmock', '~> 3.8.3'
40
40
  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: 5.0.1
4
+ version: 5.0.2
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: 2020-08-13 00:00:00.000000000 Z
12
+ date: 2020-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -133,28 +133,28 @@ dependencies:
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: 0.87.1
136
+ version: 0.90.0
137
137
  type: :development
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - "~>"
142
142
  - !ruby/object:Gem::Version
143
- version: 0.87.1
143
+ version: 0.90.0
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: simplecov
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: 0.18.2
150
+ version: 0.19.0
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: 0.18.2
157
+ version: 0.19.0
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: webmock
160
160
  requirement: !ruby/object:Gem::Requirement