Skip to content

Commit 2f77fad

Browse files
committed
Remove dependence on Object#blank? monkey patch
Nori patched `Object` to implement a `blank?` method, however it was removed in v2.7 (February 2024), so uses within this gem were now breaking without the method being implemented. Nori commit: savonrb/nori@780d01d CI was passing for Ruby < 3, since Nori v2.7 requires Ruby 3, however Ruby >= 3 was failing once it started using Nori v2.7.
1 parent dd693a3 commit 2f77fad

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixed
88
* Revert recent proxy changes which breaks proxy usage by @andrewdicken-stripe in https://github.com/NetSweet/netsuite/pull/579
9+
* Fix incompatibility with Nori v2.7+ after it removed `Object#blank?` monkey patch (#)
910

1011
### Breaking Changes
1112

lib/netsuite/actions/delete_list.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def response_list
5353
end
5454

5555
def success?
56-
@success ||= response_errors.blank?
56+
@success ||= (response_errors.nil? || response_errors.empty?)
5757
end
5858

5959
def response_errors
@@ -105,4 +105,4 @@ def delete_list(options = { }, credentials={})
105105
end
106106
end
107107
end
108-
end
108+
end

lib/netsuite/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def soap_header(headers = nil)
202202
end
203203

204204
def auth_header(credentials={})
205-
if !credentials[:consumer_key].blank? || !consumer_key.blank?
205+
if !credentials[:consumer_key].to_s.empty? || !consumer_key.to_s.empty?
206206
token_auth(credentials)
207207
else
208208
user_auth(credentials)

spec/netsuite/actions/delete_list_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676

7777
it 'constructs error objects' do
7878
response = NetSuite::Actions::DeleteList.call([klass, :list => customer_list_with_error])
79+
80+
expect(response).to_not be_success
81+
7982
expect(response.errors.keys).to match_array(customer_with_error.internal_id)
8083
expect(response.errors[customer_with_error.internal_id].first.code).to eq('USER_EXCEPTION')
8184
expect(response.errors[customer_with_error.internal_id].first.message).to eq('Invalid record: type=event,id=100015,scompid=TSTDRV96')

0 commit comments

Comments
 (0)