rasti-web 0.0.5 → 0.0.6
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 +4 -4
- data/lib/rasti/web/application.rb +4 -0
- data/lib/rasti/web/router.rb +6 -2
- data/lib/rasti/web/version.rb +1 -1
- data/spec/application_spec.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f08a5965047cf50e8e1490f7df2881465db2d6
|
4
|
+
data.tar.gz: 7b89630f3be474e823fa3bc0940f2f6ee118b622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4a4270b678f4f1488ad90ad600add5c56152acd283fe0f551936f23f1952b220a668a4db5c59713b7b228af63b3d9b4c72f3bfeed2c7ba186c949103d349ba5
|
7
|
+
data.tar.gz: ce5f7061a3c5ca721ce0accdc8321573e5f75572dafab2c5d8707a68d6e3ecf85852f98ec39e2afd658ee55d29af336de94c65b1bc397010af88b61dbfa300c6
|
data/lib/rasti/web/router.rb
CHANGED
@@ -8,7 +8,7 @@ module Rasti
|
|
8
8
|
|
9
9
|
VERBS.each do |verb|
|
10
10
|
define_method verb do |pattern, endpoint=nil, &block|
|
11
|
-
routes[verb] << Route.new(pattern, endpoint, &block)
|
11
|
+
routes[verb.upcase] << Route.new(pattern, endpoint, &block)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -22,6 +22,10 @@ module Rasti
|
|
22
22
|
route.call env
|
23
23
|
end
|
24
24
|
|
25
|
+
def all_routes
|
26
|
+
Hash[routes.map { |m,r| [m, r.map(&:pattern)] }]
|
27
|
+
end
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
def routes
|
@@ -29,7 +33,7 @@ module Rasti
|
|
29
33
|
end
|
30
34
|
|
31
35
|
def route_for(env)
|
32
|
-
routes[env['REQUEST_METHOD'].
|
36
|
+
routes[env['REQUEST_METHOD'].upcase].detect { |r| r.match? env['PATH_INFO'] } || not_found_route
|
33
37
|
end
|
34
38
|
|
35
39
|
def not_found_route
|
data/lib/rasti/web/version.rb
CHANGED
data/spec/application_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.4.
|
237
|
+
rubygems_version: 2.4.8
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: Web blocks to build robust applications
|