rack-router 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/router.rb +6 -1
- data/rack-router.gemspec +1 -1
- data/test/router_test.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b747dcf04ede8d9af6a9dd533434d308fe3be235
|
4
|
+
data.tar.gz: fcd03c4d46cbc9845048f2bd8de98147185c87eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2b421a70c5ff17147c36741b6dc6ee516403a4bf83ae7151b27ea623a04cd28006d9a144c06c4c970efba3d4285a805fd101d67e17a48706a50d639aabce0f3
|
7
|
+
data.tar.gz: 2832a925b14e452c55587adb4260ca3c6b2bc0d72040f2cd8d26bf95192a3f757b04c0b45526f245f16e2759ab343246387a13be5eb8bd071f107a9974b12fd9
|
data/lib/rack/router.rb
CHANGED
@@ -3,10 +3,11 @@ require 'rack/route'
|
|
3
3
|
module Rack
|
4
4
|
|
5
5
|
class Router
|
6
|
-
VERSION = "0.
|
6
|
+
VERSION = "0.6.0"
|
7
7
|
|
8
8
|
HEAD = 'HEAD'.freeze
|
9
9
|
GET = 'GET'.freeze
|
10
|
+
PATCH = 'PATCH'.freeze
|
10
11
|
POST = 'POST'.freeze
|
11
12
|
PUT = 'PUT'.freeze
|
12
13
|
DELETE = 'DELETE'.freeze
|
@@ -32,6 +33,10 @@ module Rack
|
|
32
33
|
route(GET, route_spec)
|
33
34
|
end
|
34
35
|
|
36
|
+
def patch(route_spec)
|
37
|
+
route(PATCH, route_spec)
|
38
|
+
end
|
39
|
+
|
35
40
|
def post(route_spec)
|
36
41
|
route(POST, route_spec)
|
37
42
|
end
|
data/rack-router.gemspec
CHANGED
data/test/router_test.rb
CHANGED
@@ -11,13 +11,15 @@ class RouterTest < Minitest::Test
|
|
11
11
|
put "/it" => app2, :as => :it
|
12
12
|
delete "/remove" => app2
|
13
13
|
get "/:id" => app1
|
14
|
+
patch "/patch" => app2
|
14
15
|
end
|
15
16
|
|
16
17
|
assert_equal([
|
17
18
|
Rack::Route.new('POST', '/stuff', app2),
|
18
19
|
Rack::Route.new('PUT', '/it', app2),
|
19
20
|
Rack::Route.new('DELETE', '/remove', app2),
|
20
|
-
Rack::Route.new('GET', '/:id', app1)
|
21
|
+
Rack::Route.new('GET', '/:id', app1),
|
22
|
+
Rack::Route.new('PATCH', '/patch', app2),
|
21
23
|
], router.routes)
|
22
24
|
|
23
25
|
assert_equal ["42"], router.call("REQUEST_METHOD" => "GET", "PATH_INFO" => "/42").last
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple router for Rack apps
|
14
14
|
email:
|