gambiarra 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gambiarra/history.rb +2 -2
- data/lib/gambiarra/router.rb +2 -2
- data/lib/gambiarra/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fc50dc84d4b5d8babd5968c7a4ce8b630470289740d0df2f48fb6d3b2b287df
|
4
|
+
data.tar.gz: 045a445151e7428c6c58d76f7cecb26151627426de7a7f74d7db0820c803ba31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2343c9c06941c640801d44a92b894f919ee73807224087547086d03812b89ece0383192631a72360b623fb54ef5a5b3f2aef695ddb2b715e941897bded24f37b
|
7
|
+
data.tar.gz: dd53d53cf7c825320c8096740d77b73cd3f72f5c9b1a89ae4ec8568878e0db42324db3f4fc269030b916fc50d0a9d05851a24b31c6fa01c4de4356bdac06c735
|
data/lib/gambiarra/history.rb
CHANGED
@@ -22,13 +22,13 @@ module Gambiarra
|
|
22
22
|
routes.pop.respond
|
23
23
|
end
|
24
24
|
|
25
|
-
def refresh(params
|
25
|
+
def refresh(**params)
|
26
26
|
return {
|
27
27
|
content: 'Abnormal end',
|
28
28
|
path: 'exit'
|
29
29
|
} unless current_route
|
30
30
|
|
31
|
-
current_route.respond(params)
|
31
|
+
current_route.respond(**params)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/lib/gambiarra/router.rb
CHANGED
@@ -18,7 +18,7 @@ module Gambiarra
|
|
18
18
|
path = params.delete(:path)
|
19
19
|
@url = build_url(path || history.current_route.path, **params)
|
20
20
|
route = routes.detect { |route| route.path == path }
|
21
|
-
return history.refresh(params) unless route
|
21
|
+
return history.refresh(**params) unless route
|
22
22
|
history.add(route)
|
23
23
|
route.respond(**params)
|
24
24
|
end
|
@@ -29,7 +29,7 @@ module Gambiarra
|
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
-
def build_url(path, params)
|
32
|
+
def build_url(path, **params)
|
33
33
|
[
|
34
34
|
path,
|
35
35
|
(params || {}).map do |k,v|
|
data/lib/gambiarra/version.rb
CHANGED