soap-response_cutter 0.0.3 → 0.0.4

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: a9b98c0c734e048dc25a4fc0942ec1217d08e1cf
4
- data.tar.gz: 11d60da98bda8a15ff67f099b7101e15cfd82cb0
3
+ metadata.gz: c00c69445799398a9a6b6eef6c412b2e86a2569d
4
+ data.tar.gz: a9e3e7c8824ea9e923989a20dd47533609e6f559
5
5
  SHA512:
6
- metadata.gz: 64b4a770f68e2f31d0085602c2b781703a2b7c26d40b9cbef2f68023456ed41e2f10acc2376a0aaa3f8150d097f1bda76cc1fc6e263bd422db047f2499ccc636
7
- data.tar.gz: 7d620c213e59e9e5daa2422b49e8b320bfeb275ff5589cf2546f89596efd83eda60e132456faf3c72a308ef29567c108e032b67da21835e51e9b90f42ff45aed
6
+ metadata.gz: af666b1f590b9d229269e225ec9a38396bf253aabae627f24fd0f3e2a33116d8c1562d1dd0ccbb27e757720ca618cf82da0324516e0ab96eb3d07dcd6abba477
7
+ data.tar.gz: b14418e84a7fe1600e2d9eb297050d46732c27d4a8353257971a91431f5120aeb3beca6d881adbb423f3f5271d52c80340b535d9ed7fc07b187127ea5d65233e
@@ -1,6 +1,6 @@
1
1
  module Soap
2
2
  # nodoc
3
3
  class ResponseCutter
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
6
6
  end
@@ -1,5 +1,6 @@
1
1
  require 'soap/response_cutter/version'
2
2
  require 'active_support/core_ext/hash'
3
+
3
4
  module Soap
4
5
  # Those are a crazy duplication and calls for some really ugly hacks
5
6
  # to get the data you are reall interested in. Fuck SOAP!
@@ -7,6 +8,7 @@ module Soap
7
8
  # Examples:
8
9
  # ResponseCutter.new(:soap_action, { somes: 'value'})
9
10
  class ResponseCutter
11
+ DeepShit = Class.new(StandardError)
10
12
  USELESS_KEYS = %w(response result return)
11
13
  attr_reader :action, :response
12
14
 
@@ -16,14 +18,17 @@ module Soap
16
18
  @response = response.dup.deep_symbolize_keys!
17
19
  end
18
20
 
19
- # rubocop:disable MethodLength
20
21
  def parse
21
22
  catch :done do
22
- flatten_response while useless_nesting?
23
+ safe_guard = 0
24
+ while useless_nesting?
25
+ flatten_response
26
+ safe_guard += 1
27
+ fail DeepShit, "#{response} could not be parsed" if safe_guard > 3
28
+ end
23
29
  end
24
30
  response
25
31
  end
26
- # rubocop:enable MethodLength
27
32
 
28
33
  private
29
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soap-response_cutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson