http_router 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -0
- data/http_router.gemspec +1 -1
- data/lib/http_router.rb +2 -0
- data/lib/http_router/version.rb +1 -1
- data/test/test_misc.rb +7 -1
- metadata +47 -36
data/Rakefile
CHANGED
@@ -3,6 +3,8 @@ require 'bundler'
|
|
3
3
|
Bundler::GemHelper.install_tasks
|
4
4
|
# Rake::Task['release'].enhance([:test, :release_js]) FIXME, this just doesn't work.
|
5
5
|
|
6
|
+
task :default => [:test]
|
7
|
+
|
6
8
|
task :release_js do
|
7
9
|
$: << 'lib'
|
8
10
|
require 'http_router/version'
|
@@ -94,6 +96,8 @@ namespace :test do
|
|
94
96
|
c = $1
|
95
97
|
raise "out was nil" if out.nil?
|
96
98
|
test = out.shift
|
99
|
+
c.gsub!(/Last-Modified:.*?[\r\n]*/)
|
100
|
+
test.gsub!(/Last-Modified:.*?[\r\n]*/)
|
97
101
|
raise "expected #{c.inspect}, received #{test.inspect}" unless c.strip == test.strip
|
98
102
|
assertion_count += 1
|
99
103
|
end
|
data/http_router.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.rdoc_options = ["--charset=UTF-8"]
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.rubygems_version = %q{1.3.7}
|
19
|
-
s.test_files = `git ls-files`.split("\n").select{|f| f =~ /^
|
19
|
+
s.test_files = `git ls-files`.split("\n").select{|f| f =~ /^test/}
|
20
20
|
s.rubyforge_project = 'http_router'
|
21
21
|
|
22
22
|
# dependencies
|
data/lib/http_router.rb
CHANGED
@@ -24,6 +24,8 @@ class HttpRouter
|
|
24
24
|
DoubleCompileError = Class.new(RuntimeError)
|
25
25
|
# Raised an invalid request value is used
|
26
26
|
InvalidRequestValueError = Class.new(RuntimeError)
|
27
|
+
# Raised when there are extra parameters passed in to #url
|
28
|
+
TooManyParametersException = Class.new(RuntimeError)
|
27
29
|
|
28
30
|
# Creates a new HttpRouter.
|
29
31
|
# Can be called with either <tt>HttpRouter.new(proc{|env| ... }, { .. options .. })</tt> or with the first argument omitted.
|
data/lib/http_router/version.rb
CHANGED
data/test/test_misc.rb
CHANGED
@@ -64,7 +64,7 @@ class TestMisc < MiniTest::Unit::TestCase
|
|
64
64
|
assert_equal '/test/var', r.url(:route, "var")
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
67
|
+
def test_too_many_params
|
68
68
|
r = HttpRouter.new
|
69
69
|
r.add(%r|/test/.*|, :path_for_generation => '/test/:variable').name(:route).default_destination
|
70
70
|
assert_equal '/test/var', r.url(:route, "var")
|
@@ -72,6 +72,12 @@ class TestMisc < MiniTest::Unit::TestCase
|
|
72
72
|
assert_raises(HttpRouter::InvalidRouteException) { r.url(:route) }
|
73
73
|
end
|
74
74
|
|
75
|
+
def test_too_many_args
|
76
|
+
r = HttpRouter.new
|
77
|
+
r.add('/').name(:route).default_destination
|
78
|
+
assert_raises(HttpRouter::TooManyParametersException) { r.url(:route, "hi") }
|
79
|
+
end
|
80
|
+
|
75
81
|
def test_public_interface
|
76
82
|
methods = HttpRouter.public_instance_methods.map(&:to_sym)
|
77
83
|
assert methods.include?(:url_mount)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 2
|
10
|
+
version: 0.10.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Hull
|
@@ -15,12 +15,13 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-09 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
+
name: rack
|
22
23
|
prerelease: false
|
23
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - ">="
|
@@ -31,12 +32,12 @@ dependencies:
|
|
31
32
|
- 0
|
32
33
|
- 0
|
33
34
|
version: 1.0.0
|
34
|
-
requirement: *id001
|
35
|
-
name: rack
|
36
35
|
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
+
name: url_mount
|
38
39
|
prerelease: false
|
39
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
42
|
requirements:
|
42
43
|
- - ~>
|
@@ -47,12 +48,12 @@ dependencies:
|
|
47
48
|
- 2
|
48
49
|
- 1
|
49
50
|
version: 0.2.1
|
50
|
-
requirement: *id002
|
51
|
-
name: url_mount
|
52
51
|
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
+
name: minitest
|
54
55
|
prerelease: false
|
55
|
-
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
57
|
none: false
|
57
58
|
requirements:
|
58
59
|
- - ~>
|
@@ -63,12 +64,12 @@ dependencies:
|
|
63
64
|
- 0
|
64
65
|
- 0
|
65
66
|
version: 2.0.0
|
66
|
-
requirement: *id003
|
67
|
-
name: minitest
|
68
67
|
type: :development
|
68
|
+
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
name: code_stats
|
70
71
|
prerelease: false
|
71
|
-
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
73
|
none: false
|
73
74
|
requirements:
|
74
75
|
- - ">="
|
@@ -77,12 +78,12 @@ dependencies:
|
|
77
78
|
segments:
|
78
79
|
- 0
|
79
80
|
version: "0"
|
80
|
-
requirement: *id004
|
81
|
-
name: code_stats
|
82
81
|
type: :development
|
82
|
+
version_requirements: *id004
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
84
85
|
prerelease: false
|
85
|
-
|
86
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
86
87
|
none: false
|
87
88
|
requirements:
|
88
89
|
- - ~>
|
@@ -93,12 +94,12 @@ dependencies:
|
|
93
94
|
- 8
|
94
95
|
- 7
|
95
96
|
version: 0.8.7
|
96
|
-
requirement: *id005
|
97
|
-
name: rake
|
98
97
|
type: :development
|
98
|
+
version_requirements: *id005
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
|
+
name: rbench
|
100
101
|
prerelease: false
|
101
|
-
|
102
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
102
103
|
none: false
|
103
104
|
requirements:
|
104
105
|
- - ">="
|
@@ -107,12 +108,12 @@ dependencies:
|
|
107
108
|
segments:
|
108
109
|
- 0
|
109
110
|
version: "0"
|
110
|
-
requirement: *id006
|
111
|
-
name: rbench
|
112
111
|
type: :development
|
112
|
+
version_requirements: *id006
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
|
+
name: json
|
114
115
|
prerelease: false
|
115
|
-
|
116
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
116
117
|
none: false
|
117
118
|
requirements:
|
118
119
|
- - ">="
|
@@ -121,12 +122,12 @@ dependencies:
|
|
121
122
|
segments:
|
122
123
|
- 0
|
123
124
|
version: "0"
|
124
|
-
requirement: *id007
|
125
|
-
name: json
|
126
125
|
type: :development
|
126
|
+
version_requirements: *id007
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
+
name: phocus
|
128
129
|
prerelease: false
|
129
|
-
|
130
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
130
131
|
none: false
|
131
132
|
requirements:
|
132
133
|
- - ">="
|
@@ -135,12 +136,12 @@ dependencies:
|
|
135
136
|
segments:
|
136
137
|
- 0
|
137
138
|
version: "0"
|
138
|
-
requirement: *id008
|
139
|
-
name: phocus
|
140
139
|
type: :development
|
140
|
+
version_requirements: *id008
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
|
+
name: bundler
|
142
143
|
prerelease: false
|
143
|
-
|
144
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
144
145
|
none: false
|
145
146
|
requirements:
|
146
147
|
- - ~>
|
@@ -151,12 +152,12 @@ dependencies:
|
|
151
152
|
- 0
|
152
153
|
- 0
|
153
154
|
version: 1.0.0
|
154
|
-
requirement: *id009
|
155
|
-
name: bundler
|
156
155
|
type: :development
|
156
|
+
version_requirements: *id009
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
|
+
name: thin
|
158
159
|
prerelease: false
|
159
|
-
|
160
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
160
161
|
none: false
|
161
162
|
requirements:
|
162
163
|
- - "="
|
@@ -167,9 +168,8 @@ dependencies:
|
|
167
168
|
- 2
|
168
169
|
- 8
|
169
170
|
version: 1.2.8
|
170
|
-
requirement: *id010
|
171
|
-
name: thin
|
172
171
|
type: :development
|
172
|
+
version_requirements: *id010
|
173
173
|
description: This library allows you to recognize and build URLs in a Rack application.
|
174
174
|
email: joshbuddy@gmail.com
|
175
175
|
executables: []
|
@@ -276,5 +276,16 @@ rubygems_version: 1.6.2
|
|
276
276
|
signing_key:
|
277
277
|
specification_version: 3
|
278
278
|
summary: A kick-ass HTTP router for use in Rack
|
279
|
-
test_files:
|
280
|
-
|
279
|
+
test_files:
|
280
|
+
- test/common/generate.txt
|
281
|
+
- test/common/http_recognize.txt
|
282
|
+
- test/common/recognize.txt
|
283
|
+
- test/generation.rb
|
284
|
+
- test/generic.rb
|
285
|
+
- test/helper.rb
|
286
|
+
- test/rack/test_route.rb
|
287
|
+
- test/recognition.rb
|
288
|
+
- test/test_misc.rb
|
289
|
+
- test/test_mounting.rb
|
290
|
+
- test/test_recognition.rb
|
291
|
+
- test/test_trailing_slash.rb
|