strelka 0.0.1.pre.239 → 0.0.1.pre.244
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.
- data/ChangeLog +89 -26
- data/Rakefile +1 -1
- data/lib/strelka/paramvalidator.rb +1 -1
- data/lib/strelka/router/default.rb +21 -30
- data/lib/strelka/router/exclusive.rb +1 -1
- data/spec/strelka/router/default_spec.rb +25 -11
- data/spec/strelka/router/exclusive_spec.rb +47 -33
- data.tar.gz.sig +2 -2
- metadata +4 -4
- metadata.gz.sig +0 -0
data/ChangeLog
CHANGED
@@ -1,3 +1,70 @@
|
|
1
|
+
2012-05-21 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* Rakefile:
|
4
|
+
Updating Inversion dependency
|
5
|
+
[87e4f57ec907] [tip]
|
6
|
+
|
7
|
+
2012-05-23 Michael Granger <ged@FaerieMUD.org>
|
8
|
+
|
9
|
+
* lib/strelka/router/default.rb, lib/strelka/router/exclusive.rb,
|
10
|
+
spec/strelka/router/default_spec.rb,
|
11
|
+
spec/strelka/router/exclusive_spec.rb:
|
12
|
+
Reversed the order of verb and path in router lookup to fix routing
|
13
|
+
[43f8d7c4ded0]
|
14
|
+
|
15
|
+
* lib/strelka/router/default.rb, spec/strelka/router/default_spec.rb:
|
16
|
+
Route HEAD requests through the GET route
|
17
|
+
[db73c6d49ea3]
|
18
|
+
|
19
|
+
2012-05-18 Michael Granger <ged@FaerieMUD.org>
|
20
|
+
|
21
|
+
* .rvm.gems:
|
22
|
+
Bumping Loggability dependency for inheritance bugfix
|
23
|
+
[81bfb789b2d2]
|
24
|
+
|
25
|
+
2012-05-18 Mahlon E. Smith <mahlon@martini.nu>
|
26
|
+
|
27
|
+
* lib/strelka/paramvalidator.rb:
|
28
|
+
Normalize parameter hash keys, so they function identically between
|
29
|
+
different serialization formats (via #parse_form_data)
|
30
|
+
[05faa86f9d4c]
|
31
|
+
|
32
|
+
2012-05-17 Michael Granger <ged@FaerieMUD.org>
|
33
|
+
|
34
|
+
* bin/strelka:
|
35
|
+
Load the apps in bin/strelka before dumping the config so
|
36
|
+
Configurability defaults for them show up
|
37
|
+
[726ed30cb34e]
|
38
|
+
|
39
|
+
* .rvm.gems, Rakefile:
|
40
|
+
Add dependency on Foreman
|
41
|
+
[9b7850d0f0f6]
|
42
|
+
|
43
|
+
* lib/strelka/app.rb:
|
44
|
+
Remove code that sets logging level in devmode now that Loggability
|
45
|
+
has Configurabilty
|
46
|
+
[ea607e1e204b]
|
47
|
+
|
48
|
+
2012-05-11 Michael Granger <ged@FaerieMUD.org>
|
49
|
+
|
50
|
+
* lib/strelka/authprovider.rb:
|
51
|
+
Correct some cut-and-paste errors in the Strelka::AuthProvider docs
|
52
|
+
[22477b16ae53]
|
53
|
+
|
54
|
+
* lib/strelka.rb:
|
55
|
+
Log the sections with defaults
|
56
|
+
[5288bf325ace]
|
57
|
+
|
58
|
+
* lib/strelka.rb:
|
59
|
+
Use the Configurability defaults API when loading the config.
|
60
|
+
[c67001fb4ad1]
|
61
|
+
|
62
|
+
2012-05-10 Michael Granger <ged@FaerieMUD.org>
|
63
|
+
|
64
|
+
* .rvm.gems, Rakefile:
|
65
|
+
Bump Loggability dependency to 0.2.
|
66
|
+
[5de83bdaab31]
|
67
|
+
|
1
68
|
2012-05-09 Michael Granger <ged@FaerieMUD.org>
|
2
69
|
|
3
70
|
* bin/strelka:
|
@@ -5,7 +72,7 @@
|
|
5
72
|
- Adding a 'config' subcommand to dump Configurability defaults for
|
6
73
|
discovered apps.
|
7
74
|
- Update for Loggability changes.
|
8
|
-
[f5c63705cd79] [
|
75
|
+
[f5c63705cd79] [github/master]
|
9
76
|
|
10
77
|
* lib/strelka/app.rb, lib/strelka/app/auth.rb:
|
11
78
|
Adding support for config-discovery
|
@@ -22,7 +89,7 @@
|
|
22
89
|
spec/strelka/httprequest/session_spec.rb,
|
23
90
|
spec/strelka/httpresponse/session_spec.rb:
|
24
91
|
Prevent unnecessary session loading and saving.
|
25
|
-
[1242808d64a6]
|
92
|
+
[1242808d64a6]
|
26
93
|
|
27
94
|
* lib/strelka/cookieset.rb, spec/strelka/cookieset_spec.rb:
|
28
95
|
Add delegation for some more Set methods to CookieSet
|
@@ -369,18 +436,16 @@
|
|
369
436
|
* Merging with ssh://hg@deveiate.org/Strelka@8f1c27819e70
|
370
437
|
[5fcd76455aad]
|
371
438
|
|
439
|
+
* Manifest.txt:
|
440
|
+
Updating the manifest
|
441
|
+
[35165b3d01cc]
|
442
|
+
|
372
443
|
2012-04-11 Mahlon E. Smith <mahlon@martini.nu>
|
373
444
|
|
374
445
|
* lib/strelka/session/default.rb:
|
375
446
|
Use the built-in securerandom method for obtaining a hex value.
|
376
447
|
[8f1c27819e70]
|
377
448
|
|
378
|
-
2012-04-11 Michael Granger <ged@FaerieMUD.org>
|
379
|
-
|
380
|
-
* Manifest.txt:
|
381
|
-
Updating the manifest
|
382
|
-
[35165b3d01cc]
|
383
|
-
|
384
449
|
2012-04-10 Michael Granger <ged@FaerieMUD.org>
|
385
450
|
|
386
451
|
* lib/strelka/app/auth.rb, lib/strelka/app/parameters.rb,
|
@@ -451,6 +516,22 @@
|
|
451
516
|
Add the ChangeLog to the ignorefile
|
452
517
|
[cc8c30d38652]
|
453
518
|
|
519
|
+
* lib/strelka/app/templating.rb:
|
520
|
+
Add API docs to the :templating plugin module
|
521
|
+
[3c160d996320]
|
522
|
+
|
523
|
+
* README.rdoc:
|
524
|
+
Add more URLs
|
525
|
+
[060962556bd1]
|
526
|
+
|
527
|
+
* Rakefile:
|
528
|
+
Oops. Fix typo
|
529
|
+
[5a8aa207860b]
|
530
|
+
|
531
|
+
* .rvm.gems, Rakefile:
|
532
|
+
Update dependencies
|
533
|
+
[787e523777d1]
|
534
|
+
|
454
535
|
2012-04-06 Mahlon E. Smith <mahlon@martini.nu>
|
455
536
|
|
456
537
|
* lib/strelka/app/sessions.rb, lib/strelka/cookie.rb,
|
@@ -468,24 +549,6 @@
|
|
468
549
|
Add a persistent DB session store, using sequel.
|
469
550
|
[99f3c3f5d6ca]
|
470
551
|
|
471
|
-
2012-04-06 Michael Granger <ged@FaerieMUD.org>
|
472
|
-
|
473
|
-
* lib/strelka/app/templating.rb:
|
474
|
-
Add API docs to the :templating plugin module
|
475
|
-
[3c160d996320]
|
476
|
-
|
477
|
-
* README.rdoc:
|
478
|
-
Add more URLs
|
479
|
-
[060962556bd1]
|
480
|
-
|
481
|
-
* Rakefile:
|
482
|
-
Oops. Fix typo
|
483
|
-
[5a8aa207860b]
|
484
|
-
|
485
|
-
* .rvm.gems, Rakefile:
|
486
|
-
Update dependencies
|
487
|
-
[787e523777d1]
|
488
|
-
|
489
552
|
2012-04-04 Michael Granger <ged@FaerieMUD.org>
|
490
553
|
|
491
554
|
* manual/src/tutorial.page:
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ hoespec = Hoe.spec 'strelka' do
|
|
26
26
|
self.dependency 'highline', '~> 1.6'
|
27
27
|
self.dependency 'sysexits', '~> 1.0'
|
28
28
|
self.dependency 'formvalidator', '~> 0.1'
|
29
|
-
self.dependency 'inversion', '~> 0.
|
29
|
+
self.dependency 'inversion', '~> 0.10'
|
30
30
|
self.dependency 'mongrel2', '~> 0.22'
|
31
31
|
self.dependency 'uuidtools', '~> 2.1'
|
32
32
|
self.dependency 'configurability', '~> 1.0'
|
@@ -348,7 +348,7 @@ class Strelka::ParamValidator < ::FormValidator
|
|
348
348
|
|
349
349
|
self.log.info "Validating request params: %p with profile: %p" %
|
350
350
|
[ params, @profile ]
|
351
|
-
@raw_form = params
|
351
|
+
@raw_form = strify_hash( params )
|
352
352
|
profile = @profile
|
353
353
|
|
354
354
|
if additional_profile
|
@@ -23,9 +23,9 @@ class Strelka::Router::Default < Strelka::Router
|
|
23
23
|
### <route>, # A hash of routing data built by the Routing plugin
|
24
24
|
### ]
|
25
25
|
def initialize( routes=[], options={} )
|
26
|
-
@routes = Hash.new {|hash,
|
27
|
-
|
28
|
-
|
26
|
+
@routes = Hash.new {|hash, path| hash[path] = {} }
|
27
|
+
|
28
|
+
routes.each {|r| self.add_route( *r ) }
|
29
29
|
|
30
30
|
super
|
31
31
|
end
|
@@ -44,8 +44,8 @@ class Strelka::Router::Default < Strelka::Router
|
|
44
44
|
def add_route( verb, path, route )
|
45
45
|
re = Regexp.compile( '^' + path.join('/') )
|
46
46
|
|
47
|
-
# Add the route keyed by
|
48
|
-
self.routes[
|
47
|
+
# Add the route keyed by path regex and HTTP verb
|
48
|
+
self.routes[ re ][ verb ] = route
|
49
49
|
end
|
50
50
|
|
51
51
|
|
@@ -53,26 +53,27 @@ class Strelka::Router::Default < Strelka::Router
|
|
53
53
|
### the UnboundMethod object of the App that should handle it.
|
54
54
|
def route_request( request )
|
55
55
|
route = nil
|
56
|
-
|
57
|
-
|
58
|
-
path.slice!( 0, 1 ) if path.start_with?( '/' ) # Strip the leading '/'
|
56
|
+
path = request.app_path || ''
|
57
|
+
verb = request.verb
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
match = self.find_longest_match( verbroutes.keys, path ) or return nil
|
59
|
+
path.slice!( 0, 1 ) if path.start_with?( '/' ) # Strip the leading '/'
|
60
|
+
self.log.debug "Looking for routes for: %p %p" % [ verb, path ]
|
61
|
+
match = self.find_longest_match( self.routes.keys, path ) or return nil
|
64
62
|
self.log.debug " longest match result: %p" % [ match ]
|
63
|
+
routekey = match.regexp
|
65
64
|
|
66
|
-
#
|
67
|
-
#
|
68
|
-
|
65
|
+
# Pick the appropriate route based on the HTTP verb of the request. HEAD requests
|
66
|
+
# use the GET route. If there isn't a defined route for the request's verb
|
67
|
+
# send a 405 (Method Not Allowed) response
|
68
|
+
verb = :GET if verb == :HEAD
|
69
|
+
verbroutes = self.routes[ routekey ]
|
70
|
+
route = verbroutes[ verb ] or not_allowed_response( verbroutes.keys )
|
69
71
|
|
70
72
|
# Inject the parameters that are part of the route path (/foo/:id) into
|
71
73
|
# the parameters hash. They'll be the named match-groups in the matching
|
72
74
|
# Regex.
|
73
|
-
route_params = match.names.
|
75
|
+
route_params = match.names.each_with_object({}) do |name, hash|
|
74
76
|
hash[ name ] = match[ name ]
|
75
|
-
hash
|
76
77
|
end
|
77
78
|
|
78
79
|
# Add routing information to the request, and merge parameters if there are any
|
@@ -83,20 +84,10 @@ class Strelka::Router::Default < Strelka::Router
|
|
83
84
|
end
|
84
85
|
|
85
86
|
|
86
|
-
###
|
87
|
-
###
|
88
|
-
|
89
|
-
def allowed_response( path )
|
90
|
-
allowed_verbs = []
|
91
|
-
|
92
|
-
routes = @routes.each do |verb, verbroutes|
|
93
|
-
allowed_verbs << verb if self.find_longest_match( verbroutes.keys, path )
|
94
|
-
end
|
87
|
+
### Build an HTTP Allowed header out of the +allowed_verbs+ and throw a 405 response.
|
88
|
+
###
|
89
|
+
def not_allowed_response( allowed_verbs )
|
95
90
|
allowed_verbs << :HEAD if allowed_verbs.include?( :GET )
|
96
|
-
|
97
|
-
self.log.debug "Allowed methods for path %s: %p" % [ path, allowed_verbs ]
|
98
|
-
return nil if allowed_verbs.empty?
|
99
|
-
|
100
91
|
allowed_hdr = allowed_verbs.map {|verb| verb.to_s.upcase }.join( ', ' )
|
101
92
|
finish_with( HTTP::METHOD_NOT_ALLOWED, 'Method not allowed.', allow: allowed_hdr )
|
102
93
|
end
|
@@ -42,7 +42,7 @@ class Strelka::Router::Exclusive < Strelka::Router::Default
|
|
42
42
|
re = Regexp.compile( '^' + path.join('/') + '$' )
|
43
43
|
|
44
44
|
# Make the Hash for the specified HTTP verb if it hasn't been created already
|
45
|
-
self.routes[
|
45
|
+
self.routes[ re ][ verb ] = route
|
46
46
|
end
|
47
47
|
|
48
48
|
end # class Strelka::Router::Default
|
@@ -39,40 +39,54 @@ describe Strelka::Router::Default do
|
|
39
39
|
context "a router with routes for 'foo', 'foo/bar'" do
|
40
40
|
|
41
41
|
before( :each ) do
|
42
|
-
@router.add_route( :GET, ['foo'], route(:
|
43
|
-
@router.add_route( :GET, ['foo','bar'], route(:
|
42
|
+
@router.add_route( :GET, ['foo'], route(:GET_foo) )
|
43
|
+
@router.add_route( :GET, ['foo','bar'], route(:GET_foo_bar) )
|
44
|
+
@router.add_route( :POST, ['foo', 'bar'], route(:POST_foo_bar) )
|
44
45
|
end
|
45
46
|
|
46
|
-
it "routes /user/foo/bar/baz to the foo/bar action" do
|
47
|
+
it "routes GET /user/foo/bar/baz to the GET foo/bar action" do
|
47
48
|
req = @request_factory.get( '/user/foo/bar/baz' )
|
48
|
-
@router.route_request( req ).should match_route( :
|
49
|
+
@router.route_request( req ).should match_route( :GET_foo_bar )
|
49
50
|
end
|
50
51
|
|
51
|
-
it "routes /user/foo/bar to the foo/bar action" do
|
52
|
+
it "routes GET /user/foo/bar to the GET foo/bar action" do
|
52
53
|
req = @request_factory.get( '/user/foo/bar' )
|
53
|
-
@router.route_request( req ).should match_route( :
|
54
|
+
@router.route_request( req ).should match_route( :GET_foo_bar )
|
54
55
|
end
|
55
56
|
|
56
|
-
it "routes /user/foo to the foo action" do
|
57
|
+
it "routes GET /user/foo to the GET foo action" do
|
57
58
|
req = @request_factory.get( '/user/foo' )
|
58
|
-
@router.route_request( req ).should match_route( :
|
59
|
+
@router.route_request( req ).should match_route( :GET_foo )
|
59
60
|
end
|
60
61
|
|
61
|
-
it "doesn't route /user" do
|
62
|
+
it "doesn't route GET /user" do
|
62
63
|
req = @request_factory.get( '/user' )
|
63
64
|
@router.route_request( req ).should be_nil()
|
64
65
|
end
|
65
66
|
|
66
|
-
it "doesn't route /user/something/foo/bar" do
|
67
|
+
it "doesn't route GET /user/something/foo/bar" do
|
67
68
|
req = @request_factory.get( '/user/something/foo/bar' )
|
68
69
|
@router.route_request( req ).should be_nil()
|
69
70
|
end
|
70
71
|
|
71
|
-
it "doesn't route /user/other" do
|
72
|
+
it "doesn't route GET /user/other" do
|
72
73
|
req = @request_factory.get( '/user/other' )
|
73
74
|
@router.route_request( req ).should be_nil()
|
74
75
|
end
|
75
76
|
|
77
|
+
it "routes HEAD requests to the GET route" do
|
78
|
+
req = @request_factory.head( '/user/foo' )
|
79
|
+
@router.route_request( req ).should match_route( :GET_foo )
|
80
|
+
end
|
81
|
+
|
82
|
+
it "responds with a 405 (method not allowed) for a DELETE request to /user/foo" do
|
83
|
+
req = @request_factory.delete( '/user/foo' )
|
84
|
+
expect {
|
85
|
+
@router.route_request( req )
|
86
|
+
}.to finish_with( HTTP::METHOD_NOT_ALLOWED, /method not allowed/i ).
|
87
|
+
and_header( allow: 'GET, HEAD' )
|
88
|
+
end
|
89
|
+
|
76
90
|
it "responds with a 405 (method not allowed) for a POST request to /user/foo" do
|
77
91
|
req = @request_factory.post( '/user/foo' )
|
78
92
|
expect {
|
@@ -38,8 +38,8 @@ describe Strelka::Router::Exclusive do
|
|
38
38
|
context "a router with routes for 'foo', 'foo/bar'" do
|
39
39
|
|
40
40
|
before( :each ) do
|
41
|
-
@router.add_route( :GET, ['foo'], route(:
|
42
|
-
@router.add_route( :GET, ['foo','bar'], route(:
|
41
|
+
@router.add_route( :GET, ['foo'], route(:GET_foo) )
|
42
|
+
@router.add_route( :GET, ['foo','bar'], route(:GET_foo_bar) )
|
43
43
|
end
|
44
44
|
|
45
45
|
it "doesn't route /user/foo/bar/baz" do
|
@@ -49,17 +49,17 @@ describe Strelka::Router::Exclusive do
|
|
49
49
|
|
50
50
|
it "routes /user/foo/bar to the foo/bar action" do
|
51
51
|
req = @request_factory.get( '/user/foo/bar' )
|
52
|
-
@router.route_request( req ).should match_route( :
|
52
|
+
@router.route_request( req ).should match_route( :GET_foo_bar )
|
53
53
|
end
|
54
54
|
|
55
55
|
it "routes /user/foo/bar?limit=10 to the foo/bar action" do
|
56
56
|
req = @request_factory.get( '/user/foo/bar?limit=10' )
|
57
|
-
@router.route_request( req ).should match_route( :
|
57
|
+
@router.route_request( req ).should match_route( :GET_foo_bar )
|
58
58
|
end
|
59
59
|
|
60
60
|
it "routes /user/foo to the foo action" do
|
61
61
|
req = @request_factory.get( '/user/foo' )
|
62
|
-
@router.route_request( req ).should match_route( :
|
62
|
+
@router.route_request( req ).should match_route( :GET_foo )
|
63
63
|
end
|
64
64
|
|
65
65
|
it "doesn't route /user" do
|
@@ -78,50 +78,64 @@ describe Strelka::Router::Exclusive do
|
|
78
78
|
|
79
79
|
before( :each ) do
|
80
80
|
@router.add_route( :GET, [], route(:fallback) )
|
81
|
-
@router.add_route( :GET, ['foo'], route(:
|
82
|
-
@router.add_route( :GET, ['foo','bar'], route(:
|
81
|
+
@router.add_route( :GET, ['foo'], route(:GET_foo) )
|
82
|
+
@router.add_route( :GET, ['foo','bar'], route(:GET_foo_bar) )
|
83
|
+
@router.add_route( :POST, ['foo','bar'], route(:POST_foo_bar) )
|
83
84
|
end
|
84
85
|
|
85
|
-
it "doesn't route /user/foo/bar/baz" do
|
86
|
+
it "doesn't route GET /user/foo/bar/baz" do
|
86
87
|
req = @request_factory.get( '/user/foo/bar/baz' )
|
87
88
|
@router.route_request( req ).should be_nil()
|
88
89
|
end
|
89
90
|
|
90
|
-
it "routes /user/foo/bar to the foo/bar action" do
|
91
|
+
it "routes GET /user/foo/bar to the GET foo/bar action" do
|
91
92
|
req = @request_factory.get( '/user/foo/bar' )
|
92
|
-
@router.route_request( req ).should match_route( :
|
93
|
+
@router.route_request( req ).should match_route( :GET_foo_bar )
|
93
94
|
end
|
94
95
|
|
95
|
-
it "routes /user/foo to the
|
96
|
+
it "routes POST /user/foo/bar to the POST foor/bar action" do
|
97
|
+
req = @request_factory.post( '/user/foo/bar' )
|
98
|
+
@router.route_request( req ).should match_route( :POST_foo_bar )
|
99
|
+
end
|
100
|
+
|
101
|
+
it "routes GET /user/foo to the GET foo action" do
|
96
102
|
req = @request_factory.get( '/user/foo' )
|
97
|
-
@router.route_request( req ).should match_route( :
|
103
|
+
@router.route_request( req ).should match_route( :GET_foo )
|
98
104
|
end
|
99
105
|
|
100
|
-
it "routes /user to the fallback action" do
|
106
|
+
it "routes GET /user to the fallback action" do
|
101
107
|
req = @request_factory.get( '/user' )
|
102
108
|
@router.route_request( req ).should match_route( :fallback )
|
103
109
|
end
|
104
110
|
|
105
|
-
it "doesn't route /user/other" do
|
111
|
+
it "doesn't route GET /user/other" do
|
106
112
|
req = @request_factory.get( '/user/other' )
|
107
113
|
@router.route_request( req ).should be_nil()
|
108
114
|
end
|
109
115
|
|
110
|
-
it "responds with an HTTP::METHOD_NOT_ALLOWED for a POST
|
116
|
+
it "responds with an HTTP::METHOD_NOT_ALLOWED for a POST to /user/foo" do
|
111
117
|
req = @request_factory.post( '/user/foo' )
|
112
118
|
expect {
|
113
119
|
@router.route_request( req )
|
114
120
|
}.to finish_with( HTTP::METHOD_NOT_ALLOWED, /method not allowed/i ).
|
115
121
|
and_header( allow: 'GET, HEAD' )
|
116
122
|
end
|
123
|
+
|
124
|
+
it "responds with an HTTP::METHOD_NOT_ALLOWED for a DELETE on /user/foo/bar" do
|
125
|
+
req = @request_factory.delete( '/user/foo/bar' )
|
126
|
+
expect {
|
127
|
+
@router.route_request( req )
|
128
|
+
}.to finish_with( HTTP::METHOD_NOT_ALLOWED, /method not allowed/i ).
|
129
|
+
and_header( allow: 'GET, POST, HEAD' )
|
130
|
+
end
|
117
131
|
end
|
118
132
|
|
119
133
|
context "a router with routes for 'foo', 'foo/\w{3}', and 'foo/\w{6}'" do
|
120
134
|
|
121
135
|
before( :each ) do
|
122
|
-
@router.add_route( :GET, ['foo'], route(:
|
123
|
-
@router.add_route( :GET, ['foo',/\w{3}/], route(:
|
124
|
-
@router.add_route( :GET, ['foo',/\w{6}/], route(:
|
136
|
+
@router.add_route( :GET, ['foo'], route(:GET_foo) )
|
137
|
+
@router.add_route( :GET, ['foo',/\w{3}/], route(:GET_foo_three) )
|
138
|
+
@router.add_route( :GET, ['foo',/\w{6}/], route(:GET_foo_six) )
|
125
139
|
end
|
126
140
|
|
127
141
|
it "doesn't route /user/foo/barbim/baz" do
|
@@ -131,7 +145,7 @@ describe Strelka::Router::Exclusive do
|
|
131
145
|
|
132
146
|
it "routes /user/foo/barbat to the foo/\w{6} action" do
|
133
147
|
req = @request_factory.get( '/user/foo/barbat' )
|
134
|
-
@router.route_request( req ).should match_route( :
|
148
|
+
@router.route_request( req ).should match_route( :GET_foo_six )
|
135
149
|
end
|
136
150
|
|
137
151
|
it "doesn't route /user/foo/bar/baz" do
|
@@ -141,12 +155,12 @@ describe Strelka::Router::Exclusive do
|
|
141
155
|
|
142
156
|
it "routes /user/foo/bar to the foo/\w{3} action" do
|
143
157
|
req = @request_factory.get( '/user/foo/bar' )
|
144
|
-
@router.route_request( req ).should match_route( :
|
158
|
+
@router.route_request( req ).should match_route( :GET_foo_three )
|
145
159
|
end
|
146
160
|
|
147
161
|
it "routes /user/foo to the foo action" do
|
148
162
|
req = @request_factory.get( '/user/foo' )
|
149
|
-
@router.route_request( req ).should match_route( :
|
163
|
+
@router.route_request( req ).should match_route( :GET_foo )
|
150
164
|
end
|
151
165
|
|
152
166
|
it "doesn't route /user" do
|
@@ -167,28 +181,28 @@ describe Strelka::Router::Exclusive do
|
|
167
181
|
context "a router with routes for: 'foo/\w{3}', then 'foo/\d+'" do
|
168
182
|
|
169
183
|
before( :each ) do
|
170
|
-
@router.add_route( :GET, ['foo',/\w{3}/], route(:
|
171
|
-
@router.add_route( :GET, ['foo',/\d+/], route(:
|
184
|
+
@router.add_route( :GET, ['foo',/\w{3}/], route(:GET_foo_three) )
|
185
|
+
@router.add_route( :GET, ['foo',/\d+/], route(:GET_foo_digit) )
|
172
186
|
end
|
173
187
|
|
174
188
|
it "routes /user/foo/1 to the foo/\d+ action" do
|
175
189
|
req = @request_factory.get( '/user/foo/1' )
|
176
|
-
@router.route_request( req ).should match_route( :
|
190
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
177
191
|
end
|
178
192
|
|
179
193
|
it "routes /user/foo/12 to the foo/\d+ action" do
|
180
194
|
req = @request_factory.get( '/user/foo/12' )
|
181
|
-
@router.route_request( req ).should match_route( :
|
195
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
182
196
|
end
|
183
197
|
|
184
198
|
it "routes /user/foo/123 to the foo/\w{3} action" do
|
185
199
|
req = @request_factory.get( '/user/foo/123' )
|
186
|
-
@router.route_request( req ).should match_route( :
|
200
|
+
@router.route_request( req ).should match_route( :GET_foo_three )
|
187
201
|
end
|
188
202
|
|
189
203
|
it "routes /user/foo/1234 to the foo/\d+ action" do
|
190
204
|
req = @request_factory.get( '/user/foo/1234' )
|
191
|
-
@router.route_request( req ).should match_route( :
|
205
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
192
206
|
end
|
193
207
|
|
194
208
|
end
|
@@ -199,28 +213,28 @@ describe Strelka::Router::Exclusive do
|
|
199
213
|
context "a router with routes for: 'foo/\d+', then 'foo/\w{3}'" do
|
200
214
|
|
201
215
|
before( :each ) do
|
202
|
-
@router.add_route( :GET, ['foo',/\d+/], route(:
|
203
|
-
@router.add_route( :GET, ['foo',/\w{3}/], route(:
|
216
|
+
@router.add_route( :GET, ['foo',/\d+/], route(:GET_foo_digit) )
|
217
|
+
@router.add_route( :GET, ['foo',/\w{3}/], route(:GET_foo_three) )
|
204
218
|
end
|
205
219
|
|
206
220
|
it "routes /user/foo/1 to the foo/\d+ action" do
|
207
221
|
req = @request_factory.get( '/user/foo/1' )
|
208
|
-
@router.route_request( req ).should match_route( :
|
222
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
209
223
|
end
|
210
224
|
|
211
225
|
it "routes /user/foo/12 to the foo/\d+ action" do
|
212
226
|
req = @request_factory.get( '/user/foo/12' )
|
213
|
-
@router.route_request( req ).should match_route( :
|
227
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
214
228
|
end
|
215
229
|
|
216
230
|
it "routes /user/foo/123 to the foo/\d+ action" do
|
217
231
|
req = @request_factory.get( '/user/foo/123' )
|
218
|
-
@router.route_request( req ).should match_route( :
|
232
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
219
233
|
end
|
220
234
|
|
221
235
|
it "routes /user/foo/1234 to the foo/\d+ action" do
|
222
236
|
req = @request_factory.get( '/user/foo/1234' )
|
223
|
-
@router.route_request( req ).should match_route( :
|
237
|
+
@router.route_request( req ).should match_route( :GET_foo_digit )
|
224
238
|
end
|
225
239
|
|
226
240
|
end
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�6U��!���8��.�3Y�w�M<��.���Wp��t3L�����c��J��q�>K)@�����Q��8p����ľ��b�����n��� �/��4�p��=C�͒����|t��7\��
|
2
|
+
(�kc��,v�M�����r��i�ڂ��n�C�X��E���p&;��G�ְYF������H�WL���g�]~�S��v�F�.`�,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strelka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.pre.
|
4
|
+
version: 0.0.1.pre.244
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
|
37
37
|
Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
|
38
38
|
cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
39
|
-
date: 2012-05-
|
39
|
+
date: 2012-05-24 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: trollop
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
requirements:
|
110
110
|
- - ~>
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: '0.
|
112
|
+
version: '0.10'
|
113
113
|
type: :runtime
|
114
114
|
prerelease: false
|
115
115
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -117,7 +117,7 @@ dependencies:
|
|
117
117
|
requirements:
|
118
118
|
- - ~>
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '0.
|
120
|
+
version: '0.10'
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: mongrel2
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|