sinatra-router 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/sinatra/router.rb +2 -1
- metadata +57 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89e770f9cecfaa6f9ef8ee2c03928c683679ef29
|
4
|
+
data.tar.gz: 5ea0e147dd53d872a318e81a3e393e3e329d01f2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 08d376d6f5eb2f90ce76a4b03073820f662b2a0914c360b2fcbba2c817608847a41eb7d3a19c716a2ec4b899af8fe1ca3f4af174a2f5483204a9fcc62d24ddd8
|
7
|
+
data.tar.gz: f611d3dad232c3c9814b63021880f9dff0232fa1d8c9f76edfd281691e0b22a8c08e6120c366afd0b0b61c17bd412a143882e2ea2c34052c314a798a19274dcf
|
data/lib/sinatra/router.rb
CHANGED
@@ -4,6 +4,7 @@ module Sinatra
|
|
4
4
|
@app = app
|
5
5
|
@apps = []
|
6
6
|
@conditions = []
|
7
|
+
@run = nil
|
7
8
|
|
8
9
|
instance_eval(&block) if block
|
9
10
|
@routes = build_routing_table
|
@@ -76,7 +77,7 @@ module Sinatra
|
|
76
77
|
# see Sinatra's `route!`
|
77
78
|
if verb_routes = @routes[verb]
|
78
79
|
verb_routes.each do |pattern, conditions, app|
|
79
|
-
if
|
80
|
+
if pattern.match(path) && conditions_match?(conditions, env)
|
80
81
|
status, headers, response = app.call(env)
|
81
82
|
|
82
83
|
# if we got a pass, keep trying routes
|
metadata
CHANGED
@@ -1,32 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brandur
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: sinatra
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.4'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3.0'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
25
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.4'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: minitest
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :development
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rack-test
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rake
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
30
75
|
description:
|
31
76
|
email: brandur@mutelight.org
|
32
77
|
executables: []
|
@@ -37,27 +82,26 @@ files:
|
|
37
82
|
homepage: https://github.com/brandur/sinatra-router
|
38
83
|
licenses:
|
39
84
|
- MIT
|
85
|
+
metadata: {}
|
40
86
|
post_install_message:
|
41
87
|
rdoc_options: []
|
42
88
|
require_paths:
|
43
89
|
- lib
|
44
90
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
91
|
requirements:
|
47
|
-
- -
|
92
|
+
- - ">="
|
48
93
|
- !ruby/object:Gem::Version
|
49
94
|
version: '0'
|
50
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
96
|
requirements:
|
53
|
-
- -
|
97
|
+
- - ">="
|
54
98
|
- !ruby/object:Gem::Version
|
55
99
|
version: '0'
|
56
100
|
requirements: []
|
57
101
|
rubyforge_project:
|
58
|
-
rubygems_version:
|
102
|
+
rubygems_version: 2.5.1
|
59
103
|
signing_key:
|
60
|
-
specification_version:
|
104
|
+
specification_version: 4
|
61
105
|
summary: A tiny vendorable router that makes it easy to try routes from a number of
|
62
106
|
different modular Sinatra applications.
|
63
107
|
test_files: []
|