sinatra-advanced-routes 0.4.0.a → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +26 -0
- data/spec/spec_helper.rb +0 -2
- metadata +67 -34
data/README.md
CHANGED
@@ -9,9 +9,16 @@ BigBand
|
|
9
9
|
Sinatra::AdvancedRoutes is part of the [BigBand](http://github.com/rkh/big_band) stack.
|
10
10
|
Check it out if you are looking for other fancy Sinatra extensions.
|
11
11
|
|
12
|
+
Installation
|
13
|
+
------------
|
14
|
+
|
15
|
+
gem install sinatra-advanced-routes
|
16
|
+
|
12
17
|
Example
|
13
18
|
-------
|
14
19
|
|
20
|
+
Route manipulation:
|
21
|
+
|
15
22
|
require "sinatra"
|
16
23
|
require "sinatra/advanced_routes"
|
17
24
|
|
@@ -38,6 +45,25 @@ Example
|
|
38
45
|
# have gotten, since it has been defined first. But wait, we can fix this!
|
39
46
|
other_route.promote
|
40
47
|
|
48
|
+
Route inspection:
|
49
|
+
|
50
|
+
require "some_sinatra_app"
|
51
|
+
|
52
|
+
SomeSinatraApp.each_route do |route|
|
53
|
+
puts "-"*20
|
54
|
+
puts route.app.name # "SomeSinatraApp"
|
55
|
+
puts route.path # that's the path given as argument to get and akin
|
56
|
+
puts route.verb # get / head / post / put / delete
|
57
|
+
puts route.file # "some_sinatra_app.rb" or something
|
58
|
+
puts route.line # the line number of the get/post/... statement
|
59
|
+
puts route.pattern # that's the pattern internally used by
|
60
|
+
puts route.keys # keys given when route was defined
|
61
|
+
puts route.conditions # conditions given when route was defined
|
62
|
+
puts route.block # the route's closure
|
63
|
+
end
|
64
|
+
|
65
|
+
Some of that fields (like conditions or pattern) can be changed (will take effect on the routing).
|
66
|
+
|
41
67
|
Usage with Sinatra::Base
|
42
68
|
------------------------
|
43
69
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-advanced-routes
|
3
|
-
version:
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 0.4.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Konstantin Haase
|
@@ -9,56 +14,82 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-04-13 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: monkey-lib
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
|
-
- -
|
22
|
-
-
|
23
|
-
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 4
|
30
|
+
- 0
|
31
|
+
- 0
|
32
|
+
version: 0.4.0.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
24
35
|
- !ruby/object:Gem::Dependency
|
25
36
|
name: sinatra-sugar
|
26
|
-
|
27
|
-
|
28
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
39
|
requirements:
|
30
|
-
- -
|
31
|
-
-
|
32
|
-
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 4
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
version: 0.4.0.0
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
33
50
|
- !ruby/object:Gem::Dependency
|
34
51
|
name: sinatra-test-helper
|
35
|
-
|
36
|
-
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
38
54
|
requirements:
|
39
|
-
- -
|
40
|
-
-
|
41
|
-
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
- 4
|
60
|
+
- 0
|
61
|
+
- 0
|
62
|
+
version: 0.4.0.0
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
42
65
|
- !ruby/object:Gem::Dependency
|
43
66
|
name: sinatra
|
44
|
-
|
45
|
-
|
46
|
-
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
47
69
|
requirements:
|
48
70
|
- - ">="
|
49
71
|
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
- 9
|
75
|
+
- 4
|
50
76
|
version: 0.9.4
|
51
|
-
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: *id004
|
52
79
|
- !ruby/object:Gem::Dependency
|
53
80
|
name: rspec
|
54
|
-
|
55
|
-
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
57
83
|
requirements:
|
58
84
|
- - ">="
|
59
85
|
- !ruby/object:Gem::Version
|
86
|
+
segments:
|
87
|
+
- 1
|
88
|
+
- 3
|
89
|
+
- 0
|
60
90
|
version: 1.3.0
|
61
|
-
|
91
|
+
type: :development
|
92
|
+
version_requirements: *id005
|
62
93
|
description: Make Sinatra routes first class objects (part of BigBand).
|
63
94
|
email: konstantin.mailinglists@googlemail.com
|
64
95
|
executables: []
|
@@ -85,18 +116,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
85
116
|
requirements:
|
86
117
|
- - ">="
|
87
118
|
- !ruby/object:Gem::Version
|
119
|
+
segments:
|
120
|
+
- 0
|
88
121
|
version: "0"
|
89
|
-
version:
|
90
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
123
|
requirements:
|
92
|
-
- - "
|
124
|
+
- - ">="
|
93
125
|
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
version: "0"
|
96
129
|
requirements: []
|
97
130
|
|
98
131
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.3.
|
132
|
+
rubygems_version: 1.3.6
|
100
133
|
signing_key:
|
101
134
|
specification_version: 3
|
102
135
|
summary: Make Sinatra routes first class objects (part of BigBand).
|