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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5575554ab4629e83f2524f4fe47ff58963909b658452a3646457da97c378d744
4
- data.tar.gz: a409c6bdd4df80abba1206e79a4adefd05d75142cbdd775e1418de33bee23ea7
3
+ metadata.gz: d1811e5ddf758cfb0143f7f2f2f00c5fb6336f87e2fe5ac31e34c1180a336357
4
+ data.tar.gz: ad18c72cc4ae6c98a0437d51b628e0e1989b7ab2f00d9ace40a057f1d4f68321
5
5
  SHA512:
6
- metadata.gz: 13eac202ecb0c2c1bfc1287298cfa45ae202949e6738c8dec1689e8a674a0d8b5b60438a8d990e1dd77159eb75cfea3a90ddd60ab30376aa6f35e21bbc4f1c51
7
- data.tar.gz: 8a43962f554a10aef1696ff990cb5096b1a211f3e8f28199b52b7ad36a6c079ad3bf070f51ad0710aec284fdb0156ff50ae7dfcfb0b6e2951cc7f0c17046de17
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.1
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/henriquefernandez/rack-http_router
58
+ homepage: https://github.com/henrique-ft/rack-http_router
59
59
  licenses:
60
60
  - MIT
61
61
  metadata: {}