culpa 0.4.1 → 0.4.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 +8 -8
- data/bin/culpa +1 -1
- data/lib/culpa.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjUxOGU1NTE3M2U2YmM1NGQ4NzI0MTg2NWU3ZmI3MDAxMzhhNDNiMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGQ4YTY4NDM1NWQxYmQxY2FiZjlhM2QyYTdiZGZmMTQ2YjllZmJiMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzI1Njk3ZWYyMDViNGM5NmJhZjViMmZhMmYyNmE2MDdlMWI0YjY4ZTE1YzYy
|
10
|
+
MmE1ZTk0Y2ZjYTNiYzY2OGE4ZTY1OTdmODY3YjVhNjNjZTg0OGVkYmVlNGYy
|
11
|
+
NTBhNTM3Y2JkMzY1YWIwNmVkZDg3ZjBhOWVjOGUxNWRlODQyN2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjYwOGVhZjEyM2FjZmZjMDU2MjBkZTAyYWJlZGIyMjE1YWEwZjBmMTMwYWI5
|
14
|
+
ZGI2MWZhM2QzNmIwOGI4MTg2ZTNjYWZmZDhiYWE5YWZjZDJhZDJmMjVmZWE0
|
15
|
+
ZjE0MzAxMjFlYTA2NGM4NzQxNzcwMzk0ZDk4OWE4ZmJhNDJhN2Q=
|
data/bin/culpa
CHANGED
@@ -65,7 +65,7 @@ end
|
|
65
65
|
|
66
66
|
def display_brick_chain
|
67
67
|
router_method_name = ARGV[1]
|
68
|
-
brickchain = Culpa::Application.new.
|
68
|
+
brickchain = Culpa::Application.new.generate_brickchain(router_method_name)
|
69
69
|
if brickchain
|
70
70
|
brickchain.each { |brick| puts " -> #{brick}" }
|
71
71
|
else
|
data/lib/culpa.rb
CHANGED
@@ -41,11 +41,11 @@ module Culpa
|
|
41
41
|
@rev_router = YAML.load_file(options[:rev_router] || './config/rev_router.yml')
|
42
42
|
end
|
43
43
|
|
44
|
-
def
|
44
|
+
def call_brickchain(options)
|
45
45
|
router_method_name = "#{options[:sub_call]}_#{options[:res_name]}"
|
46
46
|
envelope = Envelope.new
|
47
47
|
request = EnvelopeRequest.new(options)
|
48
|
-
bricks =
|
48
|
+
bricks = generate_brickchain(router_method_name)
|
49
49
|
return not_found unless bricks
|
50
50
|
bricks.each do |brick|
|
51
51
|
action_class_name, method_name = brick.split('.')
|
@@ -58,9 +58,9 @@ module Culpa
|
|
58
58
|
|
59
59
|
##
|
60
60
|
# Building the brick chain for a router method.
|
61
|
-
# Gets before
|
61
|
+
# Gets before bricks in reverse router and merge it with standard calls.
|
62
62
|
# Keeps the brickchain in cache for later calls.
|
63
|
-
def
|
63
|
+
def generate_brickchain(router_method_name)
|
64
64
|
unless @brick_call_chains_cache.has_key? router_method_name
|
65
65
|
return unless @router.has_key? router_method_name
|
66
66
|
final_call_chain = []
|
@@ -150,7 +150,7 @@ module Culpa
|
|
150
150
|
else
|
151
151
|
return bad_request
|
152
152
|
end
|
153
|
-
|
153
|
+
call_brickchain call_options
|
154
154
|
end
|
155
155
|
|
156
156
|
##
|