wash_out 0.11.0.beta.1 → 0.11.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d49adf22c0c16c3f0e8e3e2dcf694b7d6851920
4
- data.tar.gz: c42b0da56ed90cd44e4d014aff450f3bef83325f
3
+ metadata.gz: d5f141fb15bb0de83f6a21321b491bfe4877344f
4
+ data.tar.gz: c38aa890a97bbaec1eae14629d84eb62e1303ee3
5
5
  SHA512:
6
- metadata.gz: 9f2dd4239ee3fa9e449bd0903c977b5f2457382ee363cb3d1404d102f5fd0b531fe8f0e32dcee5cc6a5ff14996d60b37bb565ad702b913ac2ed344fbde90ea83
7
- data.tar.gz: c9045dd957a04e6751b9ed5ffc2a28fdc6c1d4a1c4eff7a57d8564699423a442a4975fe8c6c4cac7a451a19cd3eeda112ba8357cd0e19228d838e4d8ffcabdb4
6
+ metadata.gz: 87e9b3295e80e00d0efea3a05f316aa96367ff69569a0e4f572842e93f39af02e0b208e0c285d528227f8ec08292b150c5a49de592b346d0e237ce0bafca99cd
7
+ data.tar.gz: b42db7edf34731c880378ca6e2d9194907d20893d8886d340ccc33e52b0b925a20a387dc38f0bd6e85b81e25e3065b716ff79d2890351f7d892b18f50de37be5
@@ -4,12 +4,28 @@ module WashOut
4
4
  # This class is a Rack middleware used to route SOAP requests to a proper
5
5
  # action of a given SOAP controller.
6
6
  class Router
7
- def self.url(request, controller_name)
8
- route = Rails.application.routes.routes.select do |x|
7
+ def self.lookup_soap_routes(controller_name, routes)
8
+ results = []
9
+
10
+ routes.each do |x|
9
11
  defaults = x.defaults
10
12
  defaults = defaults[:defaults] if defaults.include?(:defaults) # Rails 5
11
- defaults[:controller] == controller_name && defaults[:action] == 'soap'
12
- end.first
13
+ if defaults[:controller] == controller_name && defaults[:action] == 'soap'
14
+ results << x
15
+ end
16
+
17
+ app = x.app
18
+ app = app.app if app.respond_to?(:app)
19
+ if app.is_a?(Class) && app.ancestors.include?(Rails::Engine)
20
+ results += lookup_soap_routes(controller_name, app.routes.routes)
21
+ end
22
+ end
23
+
24
+ results
25
+ end
26
+
27
+ def self.url(request, controller_name)
28
+ route = lookup_soap_routes(controller_name, Rails.application.routes.routes).first
13
29
 
14
30
  path = if route.respond_to?(:optimized_path) # Rails 4
15
31
  route.optimized_path
@@ -1,3 +1,3 @@
1
1
  module WashOut
2
- VERSION = "0.11.0.beta.1"
2
+ VERSION = "0.11.0.beta.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wash_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0.beta.1
4
+ version: 0.11.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-19 00:00:00.000000000 Z
12
+ date: 2016-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nori