rack-http_router 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack-http_router/action.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1811e5ddf758cfb0143f7f2f2f00c5fb6336f87e2fe5ac31e34c1180a336357
|
4
|
+
data.tar.gz: ad18c72cc4ae6c98a0437d51b628e0e1989b7ab2f00d9ace40a057f1d4f68321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6793d7c6968f766e12ed581e533416ce2eb9227ae697cb14eea469a499aba8d5b949ef5434c0be48cd557973694deed9cdb26bc71fcac2099f443586b40d986
|
7
|
+
data.tar.gz: 8a2a16819fa8842252a74c5d12f3f36c4475f0f3a13c348c4da83bd8715540852fb419c8fef9716f1aab281d54bb2f239d30ec22fb045843db13a759bba1e253
|
@@ -63,6 +63,10 @@ module Rack
|
|
63
63
|
Rack::HttpRouter::Action.erb(path, view_params)
|
64
64
|
end
|
65
65
|
|
66
|
+
def redirect_response(url)
|
67
|
+
Rack::HttpRouter::Action.redirect_response(url)
|
68
|
+
end
|
69
|
+
|
66
70
|
def redirect_to(url)
|
67
71
|
Rack::HttpRouter::Action.redirect_to(url)
|
68
72
|
end
|
@@ -143,6 +147,14 @@ module Rack
|
|
143
147
|
eval(Erubi::Engine.new(::File.read("#{path}.html.erb")).src)
|
144
148
|
end
|
145
149
|
|
150
|
+
def redirect_response(url)
|
151
|
+
Rack::Response.new(
|
152
|
+
nil,
|
153
|
+
302,
|
154
|
+
{ 'Location' => url }
|
155
|
+
)
|
156
|
+
end
|
157
|
+
|
146
158
|
def redirect_to(url)
|
147
159
|
[302, { 'Location' => url }, []]
|
148
160
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-http_router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique F. Teixeira
|
@@ -55,7 +55,7 @@ files:
|
|
55
55
|
- lib/rack-http_router/router.rb
|
56
56
|
- lib/rack-http_router/router/build_request.rb
|
57
57
|
- lib/rack-http_router/router/route.rb
|
58
|
-
homepage: https://github.com/
|
58
|
+
homepage: https://github.com/henrique-ft/rack-http_router
|
59
59
|
licenses:
|
60
60
|
- MIT
|
61
61
|
metadata: {}
|