soapy_cake 1.23.0 → 1.23.1

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
  SHA1:
3
- metadata.gz: 0473b8d2c2811b04a6e0a71e8a9b492398d95b80
4
- data.tar.gz: 2c43ff5dccb0417b72952172e41eed102e13b0b7
3
+ metadata.gz: 3709fcadb320803e1d0ca6dc207e0824c42a882e
4
+ data.tar.gz: dbf854e7043d65559bc22ad9b4c7d7fb33472935
5
5
  SHA512:
6
- metadata.gz: 02242b513f67d51c244c3dbe40e90d3e7161dfc730761b01b3ec19e39b7a227a513582225e7ff90c2109333fcb216d03bdef86ef6aa9d3fb0e44946f460cfdc2
7
- data.tar.gz: 54866733e6fa981eb41b02f7ecdd1d13465659463916922a9c485cdb9af2890e149cbcd02a11c5071d463abe2305770181183648b3161a907349c96300fb25ba
6
+ metadata.gz: 947e3659ed6e8cde1e0d4901da4cf8235e23bc0af6542dee020f6907d892f27863f0a4ed8b4ab89e08cb3f8ef5591457771ac85e9a9d5222ed13e507181db22f
7
+ data.tar.gz: 3f3f1d695178a8881ee75a06200e7e6cc269b5c7f8f242f07347fe07e3cf8f7329de373995e4e9f59966293b45df193f4261233d91465ef2801fb7cd43ce62a4
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
+ require 'net/http'
3
+
2
4
  module SoapyCake
3
5
  class Client
4
6
  HEADERS = { 'Content-Type' => 'application/soap+xml;charset=UTF-8' }.freeze
@@ -63,9 +65,21 @@ module SoapyCake
63
65
  def http_response(request)
64
66
  logger.info("soapy_cake:request #{request}") if logger
65
67
 
66
- url = "https://#{domain}#{request.path}"
67
- HTTParty.post(url, headers: HEADERS, body: request.xml, timeout: NET_TIMEOUT).tap do |res|
68
- raise RequestFailed, "Request failed with HTTP #{res.code}: #{res.body}" unless res.success?
68
+ http_request = Net::HTTP::Post.new(request.path, HEADERS)
69
+ http_request.body = request.xml
70
+ response = perform_http_request(http_request)
71
+
72
+ unless response.is_a?(Net::HTTPSuccess)
73
+ raise RequestFailed, "Request failed with HTTP #{response.code}: #{response.body}"
74
+ end
75
+
76
+ response.body
77
+ end
78
+
79
+ def perform_http_request(http_request)
80
+ Net::HTTP.start(domain,
81
+ use_ssl: true, open_timeout: NET_TIMEOUT, read_timeout: NET_TIMEOUT) do |http|
82
+ http.request(http_request)
69
83
  end
70
84
  end
71
85
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SoapyCake
3
- VERSION = '1.23.0'
3
+ VERSION = '1.23.1'
4
4
  end
data/lib/soapy_cake.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
+ require 'yaml'
2
3
  require 'logger'
3
4
  require 'nokogiri'
4
5
  require 'saxerator'
5
- require 'httparty'
6
6
  require 'retryable'
7
7
  require 'active_support/core_ext/hash/reverse_merge'
8
8
  require 'active_support/core_ext/hash/transform_values'
data/soapy_cake.gemspec CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'activesupport'
23
23
  spec.add_dependency 'saxerator'
24
24
  spec.add_dependency 'nokogiri'
25
- spec.add_dependency 'httparty'
26
25
  spec.add_dependency 'retryable'
27
26
 
28
27
  spec.add_development_dependency 'bundler'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soapy_cake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ad2games GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-30 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: httparty
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: retryable
71
57
  requirement: !ruby/object:Gem::Requirement