Skip to content

Commit

Permalink
savon update & keyword parameters fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wacaw committed Jan 27, 2023
1 parent 2cfe92e commit ae14d37
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ env:
sudo: false
language: ruby
rvm:
- 2.4
- 2.6
- 2.7.7
-3.0.5
before_install: gem install bundler

before_script:
Expand Down
3 changes: 3 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

bundle exec rake test
6 changes: 3 additions & 3 deletions gus_bir1.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'gus_bir1/version'

Expand All @@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'simplecov'

spec.add_dependency 'savon', '~> 2.12'
spec.add_dependency 'savon-multipart--feb-2019', '~> 2.1', '>= 2.1.2'
spec.add_dependency 'savon', '~> 2.14'
spec.add_dependency 'savon-multipart'
end
4 changes: 2 additions & 2 deletions lib/gus_bir1/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_full_data_from_response(hash)
end

def find_and_get_full_data(hash)
r = find_by(hash)
r = find_by(**hash)
r.map { |h| get_full_data_from_response(h) }
end

Expand All @@ -85,7 +85,7 @@ def endpoint

def method_missing(method, *args)
if savon_client.operations.include? method
response_hash = call(method, args[0]).hash
response_hash = call(method, args[0]).full_hash
response_hash.dig(:envelope, :body, "#{method}_response".to_sym, "#{method}_result".to_sym)
else
super
Expand Down
2 changes: 1 addition & 1 deletion lib/gus_bir1/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module GusBir1
VERSION = '1.1.0'
VERSION = '1.2.0'
end
6 changes: 2 additions & 4 deletions test/gus_bir1_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ def test_find_by_krs
end

def test_find_by_regons14
response = GusBir1.find_by(regons14: '00033150100000,02121583300000')
assert_equal 2, response.size
assert_equal @gus_hash, response.first.to_h
assert_equal @psp_hash, response.last.to_h
response = GusBir1.find_by(regons14: '09144355400025')
assert_equal 1, response.size
end

def test_find_by_regons9
Expand Down

0 comments on commit ae14d37

Please sign in to comment.