line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This file is generated by author/assets.pl. Do not edit manually. |
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
347
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
71
|
|
4
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
95
|
|
5
|
|
|
|
|
|
|
<<',,,'; |
6
|
|
|
|
|
|
|
<script src="<: uri_for('/static/js/micro_dispatcher.js') :>"></script> |
7
|
1
|
|
|
1
|
0
|
4
|
,,, |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
return { |
11
|
|
|
|
|
|
|
'js/micro_dispatcher.js' => '// micro_dispatcher.js - (C) tokuhirom, MIT License. |
12
|
|
|
|
|
|
|
(function() { |
13
|
|
|
|
|
|
|
var namedParam = /:([\\w\\d]+)/g; |
14
|
0
|
|
|
0
|
0
|
|
var splatParam = /\\*([\\w\\d]+)/g; |
15
|
|
|
|
|
|
|
var escapeRegExp = /[\\-\\[\\]{}()+?.,\\\\\\^$|#\\s]/g; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
// http://perfectionkills.com/instanceof-considered-harmful-or-how-to-write-a-robust-isarray/ |
18
|
|
|
|
|
|
|
var toString = Object.prototype.toString; |
19
|
|
|
|
|
|
|
function isRegExp(obj) { |
20
|
|
|
|
|
|
|
return toString.call(obj)==\'[object RegExp]\'; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
function Dispatcher() { |
24
|
|
|
|
|
|
|
this.routes = []; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
Dispatcher.prototype = { |
27
|
|
|
|
|
|
|
register: function(route, callback) { |
28
|
|
|
|
|
|
|
if (!isRegExp(route)) { |
29
|
|
|
|
|
|
|
route = this._compileRoute(route); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
this.routes.push([route, callback]); |
32
|
|
|
|
|
|
|
}, |
33
|
|
|
|
|
|
|
dispatch: function (path) { |
34
|
|
|
|
|
|
|
var routes = this.routes; |
35
|
|
|
|
|
|
|
for (var i=0, l=routes.length; i<l; i++) { |
36
|
|
|
|
|
|
|
var route = this.routes[i][0]; |
37
|
|
|
|
|
|
|
var callback = this.routes[i][1]; |
38
|
|
|
|
|
|
|
var matched = route.exec(path); |
39
|
|
|
|
|
|
|
if (matched) { |
40
|
|
|
|
|
|
|
var args = matched.slice(1); |
41
|
|
|
|
|
|
|
callback.apply(this, args); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
_compileRoute : function(route) { |
46
|
|
|
|
|
|
|
route = route.replace(escapeRegExp, "\\\\$&").replace(namedParam, "([^\\/]+)").replace(splatParam, "(.*?)"); |
47
|
|
|
|
|
|
|
return new RegExp(\'^\' + route + \'$\'); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
this.MicroDispatcher = Dispatcher; |
51
|
|
|
|
|
|
|
})(); |
52
|
|
|
|
|
|
|
' |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |