path => "/hi/:ba"
block, pattern, keys, conditions = compile! verb, path, block, options
pattern => /^\/hi\/([^\/?#]+)$/
22: self = Sinatra::Application
(rdb:1) disp self.routes
23: self.routes = {"GET"=>[[/^\/$/, [], [], #<Proc:0x90f5484@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/hi\/([^\/?#]+)$/, ["ba"], [], #<Proc:0x9164bf4@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/hi$/, [], [], #<Proc:0x8ff33c4@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/bye$/, [], [], #<Proc:0x8d42af8@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>]], "HEAD"=>[[/^\/$/, [], [], #<Proc:0x8e1e774@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/hi\/([^\/?#]+)$/, ["ba"], [], #<Proc:0x914f880@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/hi$/, [], [], #<Proc:0x8f77b70@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>], [/^\/bye$/, [], [], #<Proc:0x94763b0@/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.6/lib/sinatra/base.rb:1152>]]}
(rdb:1) disp $0
4: $0 = hi.rb
(rdb:1) disp app_file
5: app_file = hi.rb
704 def route!(base = settings, pass_block=nil)
705 debugger
=> 706 if routes = base.routes[@request.request_method]
707 routes.each do |pattern, keys, conditions, block|
708 pass_block = process_route(pattern, keys, conditions) do
709 route_eval(&block)
710 end
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
task :routes => :environment do
Rails.application.reload_routes!
all_routes = Rails.application.routes.routes
if ENV['CONTROLLER']
all_routes = all_routes.select{ |route| route.defaults[:controller] == ENV['CONTROLLER'] }
end
routes = all_routes.collect do |route|
reqs = route.requirements.dup
reqs[:to] = route.app unless route.app.class.name.to_s =~ /^ActionDispatch::Routing/
reqs = reqs.empty? ? "" : reqs.inspect
{:name => route.name.to_s, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
end
routes.reject! { |r| r[:path] =~ %r{/rails/info/properties} } # Skip the route if it's internal info route
name_width = routes.map{ |r| r[:name].length }.max
verb_width = routes.map{ |r| r[:verb].length }.max
path_width = routes.map{ |r| r[:path].length }.max
routes.each do |r|
puts "#{r[:name].rjust(name_width)} #{r[:verb].ljust(verb_width)} #{r[:path].ljust(path_width)} #{r[:reqs]}"
end
end
分享到:
相关推荐
<add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/> //页面加载时注册ajaxpro.2,_Default为页面的类 protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility....
import barecmaes2 as cma res = cma.fmin( 目标函数名, 结果向量的初始值, cmaes寻找值的标准差, 目标函数的其他参数, ...eg: res = cma.fmin(cma.Fcts.elli, 10 * [0.5], 0.3, verb_disp=100,verb_plot=0)
useEnglish 资源E nglish Phrasal Verb & Idiom
概括 小型,简单的独立路由器,旨在与Rack应用程序一起使用。 特征 类似于Sinatra的DSL,用于定义操作 模块化架构(请参阅“路由引擎”部分) 没有魔法 ... route = self.class.routes.match(verb,
<add verb="*" path="*.ashx" type="AjaxPro.AjaxBitmapHttpHandler,AjaxPro.2"/> Ajax.dll的配置文件写法为 <add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" /> AjaxPro....
powershell -c "start cmd -ArgumentList '/c set ElevError=Y& call %args%' -verb runas" && exit /b :Elev_Err_1 %ErrLine% echo Right click on this file and select 'Run as administrator' goto MASend...
powershell -c "start cmd -ArgumentList '/c set ElevError=Y& call %args%' -verb runas" && exit /b :Elev_Err_1 %ErrLine% echo Right click on this file and select 'Run as administrator' goto MASend...
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> --> <!--使用自定义...
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> --> <!--使用自定义...
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <compilation debug=...
<add verb="*" path="Telerik.RadUploadProgressHandler.aspx" type="Telerik.WebControls.RadUploadProgressHandler, RadUpload.Net2" /> <add name="RadUploadModule" type="Telerik.WebControls....
3.在 节点中的 下面配置 <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /><...
假设你经常需要编辑自己的”hosts”文件,这时你也许会手动在记事本... Start-Process -FilePath notepad -ArgumentList $Path -Verb runas } 支持所有PS版本 您可能感兴趣的文章:PowerShell小技巧之观察UNC路径Power
华为F501 VERB 21 V200刷机平台是一款专为华为特定型号设备设计的系统更新工具,它允许用户对设备进行固件升级、系统修复或个性化定制等操作。通过这个平台,用户可以提升设备的性能,解决可能出现的软件问题,或者...
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\...
查了很多处理日志,说的都是在Web.Config里面加什么语句,就是下面这些: 代码如下:< httpHandlers> < remove verb=”*” path=”*.asmx”/> < add verb=”*” path=”*.asmx” validate=”false” type=”System.Web...
let verb = " log " let function = " Reads the log " func run ( _ options : Options) -> Result<(), YourErrorType> { // Use the parsed options to do something interesting here. return () } } ...
咕verb动词 Verb的Grunt插件,降价文档生成器,需要零配置。 其他工具: 从命令行获取以使用动词 获取以添加文档模板,或为新项目初始化文档 获取gulp工作流程的 用安装 npm install grunt-verb --save-dev 您还...
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\...
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /> 然后改iis映射 右键点我...