ey_services_fake 0.3.5 → 0.3.6
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.
data/ey_services_fake.gemspec
CHANGED
|
@@ -21,6 +21,43 @@ module EyServicesFake
|
|
|
21
21
|
new(actors)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
+
def app_for(actor_name)
|
|
25
|
+
this = self
|
|
26
|
+
@apps ||= {}
|
|
27
|
+
@apps[actor_name] ||= Rack::Builder.new do
|
|
28
|
+
this.actors.each do |k, actor|
|
|
29
|
+
if actor.respond_to?(:extra_middlewares)
|
|
30
|
+
self.instance_eval(&actor.extra_middlewares)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
if ENV["REQUEST_DEBUG"]
|
|
34
|
+
require 'request_visualizer'
|
|
35
|
+
use RequestVisualizer do |str|
|
|
36
|
+
found = str
|
|
37
|
+
this.actors.each do |k, actor|
|
|
38
|
+
if str.match(actor.base_url)
|
|
39
|
+
found = k.to_s
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
found
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
run this.actors[actor_name].app
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def app
|
|
50
|
+
this = self
|
|
51
|
+
@app ||= Rack::Builder.new do
|
|
52
|
+
this.actors.each do |k, actor|
|
|
53
|
+
map "#{actor.base_url}/" do
|
|
54
|
+
run this.app_for(k)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
attr_reader :actors
|
|
24
61
|
def initialize(actors)
|
|
25
62
|
@actors = actors
|
|
26
63
|
end
|
|
@@ -38,8 +75,8 @@ module EyServicesFake
|
|
|
38
75
|
def awsm
|
|
39
76
|
awsm_hash = actor(:tresfiestas).find_awsm
|
|
40
77
|
unless awsm_hash
|
|
41
|
-
awsm_hash = actor(:tresfiestas).create_awsm(actor(:awsm).base_url,
|
|
42
|
-
actor(:awsm).setup(awsm_hash[:auth_id], awsm_hash[:auth_key], actor(:tresfiestas).base_url,
|
|
78
|
+
awsm_hash = actor(:tresfiestas).create_awsm(actor(:awsm).base_url, app_for(:awsm))
|
|
79
|
+
actor(:awsm).setup(awsm_hash[:auth_id], awsm_hash[:auth_key], actor(:tresfiestas).base_url, app_for(:tresfiestas))
|
|
43
80
|
end
|
|
44
81
|
awsm_hash
|
|
45
82
|
end
|
|
@@ -47,13 +84,13 @@ module EyServicesFake
|
|
|
47
84
|
def partner
|
|
48
85
|
partner_hash = actor(:tresfiestas).find_partner(sso_user)
|
|
49
86
|
unless partner_hash
|
|
50
|
-
partner_hash = actor(:tresfiestas).create_partner(sso_user, actor(:service_provider).base_url,
|
|
87
|
+
partner_hash = actor(:tresfiestas).create_partner(sso_user, actor(:service_provider).base_url, app_for(:service_provider))
|
|
51
88
|
@actors.values.each do |actor|
|
|
52
89
|
if actor.respond_to?(:service_provider_setup)
|
|
53
|
-
actor.service_provider_setup(partner_hash[:auth_id], partner_hash[:auth_key], actor(:service_provider).base_url,
|
|
90
|
+
actor.service_provider_setup(partner_hash[:auth_id], partner_hash[:auth_key], actor(:service_provider).base_url, app_for(:service_provider))
|
|
54
91
|
end
|
|
55
92
|
end
|
|
56
|
-
actor(:service_provider).setup(partner_hash[:auth_id], partner_hash[:auth_key], actor(:tresfiestas).base_url,
|
|
93
|
+
actor(:service_provider).setup(partner_hash[:auth_id], partner_hash[:auth_key], actor(:tresfiestas).base_url, app_for(:tresfiestas))
|
|
57
94
|
end
|
|
58
95
|
partner_hash
|
|
59
96
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ey_services_fake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 31
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 3
|
|
9
|
-
-
|
|
10
|
-
version: 0.3.
|
|
9
|
+
- 6
|
|
10
|
+
version: 0.3.6
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Jacob Burkhart & Josh Lane
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-03-
|
|
18
|
+
date: 2012-03-16 00:00:00 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: sinatra
|
|
@@ -47,6 +47,20 @@ dependencies:
|
|
|
47
47
|
version: 0.2.0
|
|
48
48
|
type: :runtime
|
|
49
49
|
version_requirements: *id002
|
|
50
|
+
- !ruby/object:Gem::Dependency
|
|
51
|
+
name: request_visualizer
|
|
52
|
+
prerelease: false
|
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
54
|
+
none: false
|
|
55
|
+
requirements:
|
|
56
|
+
- - ">="
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
hash: 3
|
|
59
|
+
segments:
|
|
60
|
+
- 0
|
|
61
|
+
version: "0"
|
|
62
|
+
type: :runtime
|
|
63
|
+
version_requirements: *id003
|
|
50
64
|
description: A fake for use when writting tests against the ey_services_api
|
|
51
65
|
email:
|
|
52
66
|
- jacob@engineyard.com
|