5212 lines
172 KiB
HTML
5212 lines
172 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
<title>NameError at /</title>
|
|
|
|
<script type="text/javascript">
|
|
//<!--
|
|
function toggle(id) {
|
|
var pre = document.getElementById("pre-" + id);
|
|
var post = document.getElementById("post-" + id);
|
|
var context = document.getElementById("context-" + id);
|
|
|
|
if (pre.style.display == 'block') {
|
|
pre.style.display = 'none';
|
|
post.style.display = 'none';
|
|
context.style.background = "none";
|
|
} else {
|
|
pre.style.display = 'block';
|
|
post.style.display = 'block';
|
|
context.style.background = "#fffed9";
|
|
}
|
|
}
|
|
|
|
function toggleBacktrace(){
|
|
var bt = document.getElementById("backtrace");
|
|
var toggler = document.getElementById("expando");
|
|
|
|
if (bt.className == 'condensed') {
|
|
bt.className = 'expanded';
|
|
toggler.innerHTML = "(condense)";
|
|
} else {
|
|
bt.className = 'condensed';
|
|
toggler.innerHTML = "(expand)";
|
|
}
|
|
}
|
|
//-->
|
|
</script>
|
|
|
|
<style type="text/css" media="screen">
|
|
* {margin: 0; padding: 0; border: 0; outline: 0;}
|
|
div.clear {clear: both;}
|
|
body {background: #EEEEEE; margin: 0; padding: 0;
|
|
font-family: 'Lucida Grande', 'Lucida Sans Unicode',
|
|
'Garuda';}
|
|
code {font-family: 'Lucida Console', monospace;
|
|
font-size: 12px;}
|
|
li {height: 18px;}
|
|
ul {list-style: none; margin: 0; padding: 0;}
|
|
ol:hover {cursor: pointer;}
|
|
ol li {white-space: pre;}
|
|
#explanation {font-size: 12px; color: #666666;
|
|
margin: 20px 0 0 100px;}
|
|
/* WRAP */
|
|
#wrap {width: 1000px; background: #FFFFFF; margin: 0 auto;
|
|
padding: 30px 50px 20px 50px;
|
|
border-left: 1px solid #DDDDDD;
|
|
border-right: 1px solid #DDDDDD;}
|
|
/* HEADER */
|
|
#header {margin: 0 auto 25px auto;}
|
|
#header img {float: left;}
|
|
#header #summary {float: left; margin: 12px 0 0 20px; width:660px;
|
|
font-family: 'Lucida Grande', 'Lucida Sans Unicode';}
|
|
h1 {margin: 0; font-size: 36px; color: #981919;}
|
|
h2 {margin: 0; font-size: 22px; color: #333333;}
|
|
#header ul {margin: 0; font-size: 12px; color: #666666;}
|
|
#header ul li strong{color: #444444;}
|
|
#header ul li {display: inline; padding: 0 10px;}
|
|
#header ul li.first {padding-left: 0;}
|
|
#header ul li.last {border: 0; padding-right: 0;}
|
|
/* BODY */
|
|
#backtrace,
|
|
#get,
|
|
#post,
|
|
#cookies,
|
|
#rack {width: 980px; margin: 0 auto 10px auto;}
|
|
p#nav {float: right; font-size: 14px;}
|
|
/* BACKTRACE */
|
|
a#expando {float: left; padding-left: 5px; color: #666666;
|
|
font-size: 14px; text-decoration: none; cursor: pointer;}
|
|
a#expando:hover {text-decoration: underline;}
|
|
h3 {float: left; width: 100px; margin-bottom: 10px;
|
|
color: #981919; font-size: 14px; font-weight: bold;}
|
|
#nav a {color: #666666; text-decoration: none; padding: 0 5px;}
|
|
#backtrace li.frame-info {background: #f7f7f7; padding-left: 10px;
|
|
font-size: 12px; color: #333333;}
|
|
#backtrace ul {list-style-position: outside; border: 1px solid #E9E9E9;
|
|
border-bottom: 0;}
|
|
#backtrace ol {width: 920px; margin-left: 50px;
|
|
font: 10px 'Lucida Console', monospace; color: #666666;}
|
|
#backtrace ol li {border: 0; border-left: 1px solid #E9E9E9;
|
|
padding: 2px 0;}
|
|
#backtrace ol code {font-size: 10px; color: #555555; padding-left: 5px;}
|
|
#backtrace-ul li {border-bottom: 1px solid #E9E9E9; height: auto;
|
|
padding: 3px 0;}
|
|
#backtrace-ul .code {padding: 6px 0 4px 0;}
|
|
#backtrace.condensed .system,
|
|
#backtrace.condensed .framework {display:none;}
|
|
/* REQUEST DATA */
|
|
p.no-data {padding-top: 2px; font-size: 12px; color: #666666;}
|
|
table.req {width: 980px; text-align: left; font-size: 12px;
|
|
color: #666666; padding: 0; border-spacing: 0;
|
|
border: 1px solid #EEEEEE; border-bottom: 0;
|
|
border-left: 0;
|
|
clear:both}
|
|
table.req tr th {padding: 2px 10px; font-weight: bold;
|
|
background: #F7F7F7; border-bottom: 1px solid #EEEEEE;
|
|
border-left: 1px solid #EEEEEE;}
|
|
table.req tr td {padding: 2px 20px 2px 10px;
|
|
border-bottom: 1px solid #EEEEEE;
|
|
border-left: 1px solid #EEEEEE;}
|
|
/* HIDE PRE/POST CODE AT START */
|
|
.pre-context,
|
|
.post-context {display: none;}
|
|
|
|
table td.code {width:750px}
|
|
table td.code div {width:750px;overflow:hidden}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="wrap">
|
|
<div id="header">
|
|
<img src="/__sinatra__/500.png" alt="application error" height="161" width="313" />
|
|
<div id="summary">
|
|
<h1><strong>NameError</strong> at <strong>/
|
|
</strong></h1>
|
|
<h2>uninitialized constant Attentive::Sinatra::Pygments</h2>
|
|
<ul>
|
|
<li class="first"><strong>file:</strong> <code>
|
|
layout.haml</code></li>
|
|
<li><strong>location:</strong> <code>evaluate_source
|
|
</code></li>
|
|
<li class="last"><strong>line:
|
|
</strong> 6</li>
|
|
</ul>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
|
|
<div id="backtrace" class='condensed'>
|
|
<h3>BACKTRACE</h3>
|
|
<p><a href="#" id="expando"
|
|
onclick="toggleBacktrace(); return false">(expand)</a></p>
|
|
<p id="nav"><strong>JUMP TO:</strong>
|
|
<a href="#get-info">GET</a>
|
|
<a href="#post-info">POST</a>
|
|
<a href="#cookie-info">COOKIES</a>
|
|
<a href="#env-info">ENV</a>
|
|
</p>
|
|
<div class="clear"></div>
|
|
|
|
<ul id="backtrace-ul">
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/views/layout.haml</code> in
|
|
<code><strong>evaluate_source</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="1"
|
|
class="pre-context" id="pre-1"
|
|
onclick="toggle(1);">
|
|
|
|
<li class="pre-context-line"><code>!!!
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>%html
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> %head
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> %title= Attentive.title
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> %script{:type => 'text/javascript', :src => 'assets/application.js'}
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="6" class="context" id="1"
|
|
onclick="toggle(1);">
|
|
<li class="context-line" id="context-1"><code> %style{:type => 'text/css'}= Pygments.css</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="7" class="post-context"
|
|
id="post-1" onclick="toggle(1);">
|
|
|
|
<li class="post-context-line"><code> %link{:rel => 'stylesheet', :href => 'assets/application.css', :type => 'text/css'}/
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> = haml :"_header"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> %body.loading
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> = yield
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb</code> in
|
|
<code><strong>instance_eval</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="202"
|
|
class="pre-context" id="pre-2"
|
|
onclick="toggle(2);">
|
|
|
|
<li class="pre-context-line"><code> compile_template_method(locals_keys)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Evaluate the template source in the context of the scope object.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def evaluate_source(scope, locals, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> source, offset = precompiled(locals)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="209" class="context" id="2"
|
|
onclick="toggle(2);">
|
|
<li class="context-line" id="context-2"><code> scope.instance_eval(source, eval_file, line - offset)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="210" class="post-context"
|
|
id="post-2" onclick="toggle(2);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # JRuby doesn't allow Object#instance_eval to yield to the block it's
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # closed over. This is by design and (ostensibly) something that will
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # change in MRI, though no current MRI version tested (1.8.6 - 1.9.2)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # exhibits the behavior. More info here:
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb</code> in
|
|
<code><strong>evaluate_source</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="202"
|
|
class="pre-context" id="pre-3"
|
|
onclick="toggle(3);">
|
|
|
|
<li class="pre-context-line"><code> compile_template_method(locals_keys)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Evaluate the template source in the context of the scope object.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def evaluate_source(scope, locals, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> source, offset = precompiled(locals)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="209" class="context" id="3"
|
|
onclick="toggle(3);">
|
|
<li class="context-line" id="context-3"><code> scope.instance_eval(source, eval_file, line - offset)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="210" class="post-context"
|
|
id="post-3" onclick="toggle(3);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # JRuby doesn't allow Object#instance_eval to yield to the block it's
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # closed over. This is by design and (ostensibly) something that will
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # change in MRI, though no current MRI version tested (1.8.6 - 1.9.2)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # exhibits the behavior. More info here:
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb</code> in
|
|
<code><strong>cached_evaluate</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="137"
|
|
class="pre-context" id="pre-4"
|
|
onclick="toggle(4);">
|
|
|
|
<li class="pre-context-line"><code> # Redefine itself to use method compilation the next time:
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def self.cached_evaluate(scope, locals, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> method = compiled_method(locals.keys)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> method.bind(scope).call(locals, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Use instance_eval the first time:
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="144" class="context" id="4"
|
|
onclick="toggle(4);">
|
|
<li class="context-line" id="context-4"><code> evaluate_source(scope, locals, &block)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="145" class="post-context"
|
|
id="post-4" onclick="toggle(4);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Generates all template source by combining the preamble, template, and
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # postamble and returns a two-tuple of the form: [source, offset], where
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # source is the string containing (Ruby) source code for the template and
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # offset is the integer line offset where line reporting should begin.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb</code> in
|
|
<code><strong>evaluate</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="120"
|
|
class="pre-context" id="pre-5"
|
|
onclick="toggle(5);">
|
|
|
|
<li class="pre-context-line"><code> compile!
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> else
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> raise NotImplementedError
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def evaluate(scope, locals, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="127" class="context" id="5"
|
|
onclick="toggle(5);">
|
|
<li class="context-line" id="context-5"><code> cached_evaluate(scope, locals, &block)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="128" class="post-context"
|
|
id="post-5" onclick="toggle(5);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Process the template and return the result. The first time this
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # method is called, the template source is evaluated with instance_eval.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # On the sequential method calls it will compile the template to an
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # unbound method which will lead to better performance. In any case,
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # template executation is guaranteed to be performed in the scope object
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/haml.rb</code> in
|
|
<code><strong>evaluate</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="17"
|
|
class="pre-context" id="pre-6"
|
|
onclick="toggle(6);">
|
|
|
|
<li class="pre-context-line"><code> def prepare
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> options = @options.merge(:filename => eval_file, :line => line)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @engine = ::Haml::Engine.new(data, options)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def evaluate(scope, locals, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if @engine.respond_to?(:precompiled_method_return_value, true)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="24" class="context" id="6"
|
|
onclick="toggle(6);">
|
|
<li class="context-line" id="context-6"><code> super</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="25" class="post-context"
|
|
id="post-6" onclick="toggle(6);">
|
|
|
|
<li class="post-context-line"><code> else
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @engine.render(scope, locals, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Precompiled Haml source. Taken from the precompiled_with_ambles
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # method in Haml::Precompiler:
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/tilt-1.3.3/lib/tilt/template.rb</code> in
|
|
<code><strong>render</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="69"
|
|
class="pre-context" id="pre-7"
|
|
onclick="toggle(7);">
|
|
|
|
<li class="pre-context-line"><code> prepare
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Render the template in the given scope with the locals specified. If a
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # block is given, it is typically available within the template via
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # +yield+.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(scope=Object.new, locals={}, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="76" class="context" id="7"
|
|
onclick="toggle(7);">
|
|
<li class="context-line" id="context-7"><code> evaluate scope, locals || {}, &block</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="77" class="post-context"
|
|
id="post-7" onclick="toggle(7);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # The basename of the template file.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def basename(suffix='')
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> File.basename(file, suffix) if file
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>render</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="629"
|
|
class="pre-context" id="pre-8"
|
|
onclick="toggle(8);">
|
|
|
|
<li class="pre-context-line"><code> scope = options.delete(:scope) || self
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # compile and render template
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> begin
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> layout_was = @default_layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @default_layout = false
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> template = compile_template(engine, data, options, views)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="636" class="context" id="8"
|
|
onclick="toggle(8);">
|
|
<li class="context-line" id="context-8"><code> output = template.render(scope, locals, &block)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="637" class="post-context"
|
|
id="post-8" onclick="toggle(8);">
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @default_layout = layout_was
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # render layout
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if layout
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>block in render</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="204"
|
|
class="pre-context" id="pre-9"
|
|
onclick="toggle(9);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> settings.views.each do |view|
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="211" class="context" id="9"
|
|
onclick="toggle(9);">
|
|
<li class="context-line" id="context-9"><code> return super(engine, data, options.merge(:views => view), locals, &block)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="212" class="post-context"
|
|
id="post-9" onclick="toggle(9);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>each</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="200"
|
|
class="pre-context" id="pre-10"
|
|
onclick="toggle(10);">
|
|
|
|
<li class="pre-context-line"><code> haml :index, :ugly => true
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> set :views, [ File.join(Dir.pwd, 'views'), Attentive.root.join('views')]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="207" class="context" id="10"
|
|
onclick="toggle(10);">
|
|
<li class="context-line" id="context-10"><code> settings.views.each do |view|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="208" class="post-context"
|
|
id="post-10" onclick="toggle(10);">
|
|
|
|
<li class="post-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return super(engine, data, options.merge(:views => view), locals, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>render</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="200"
|
|
class="pre-context" id="pre-11"
|
|
onclick="toggle(11);">
|
|
|
|
<li class="pre-context-line"><code> haml :index, :ugly => true
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> set :views, [ File.join(Dir.pwd, 'views'), Attentive.root.join('views')]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="207" class="context" id="11"
|
|
onclick="toggle(11);">
|
|
<li class="context-line" id="context-11"><code> settings.views.each do |view|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="208" class="post-context"
|
|
id="post-11" onclick="toggle(11);">
|
|
|
|
<li class="post-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return super(engine, data, options.merge(:views => view), locals, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in render</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="637"
|
|
class="pre-context" id="pre-12"
|
|
onclick="toggle(12);">
|
|
|
|
<li class="pre-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @default_layout = layout_was
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # render layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="644" class="context" id="12"
|
|
onclick="toggle(12);">
|
|
<li class="context-line" id="context-12"><code> catch(:layout_missing) { return render(layout_engine, layout, options, locals) { output } }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="645" class="post-context"
|
|
id="post-12" onclick="toggle(12);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output.extend(ContentTyped).content_type = content_type if content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def compile_template(engine, data, options, views)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>catch</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="637"
|
|
class="pre-context" id="pre-13"
|
|
onclick="toggle(13);">
|
|
|
|
<li class="pre-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @default_layout = layout_was
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # render layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="644" class="context" id="13"
|
|
onclick="toggle(13);">
|
|
<li class="context-line" id="context-13"><code> catch(:layout_missing) { return render(layout_engine, layout, options, locals) { output } }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="645" class="post-context"
|
|
id="post-13" onclick="toggle(13);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output.extend(ContentTyped).content_type = content_type if content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def compile_template(engine, data, options, views)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>render</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="637"
|
|
class="pre-context" id="pre-14"
|
|
onclick="toggle(14);">
|
|
|
|
<li class="pre-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @default_layout = layout_was
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # render layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if layout
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> options = options.merge(:views => views, :layout => false, :eat_errors => eat_errors, :scope => scope)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="644" class="context" id="14"
|
|
onclick="toggle(14);">
|
|
<li class="context-line" id="context-14"><code> catch(:layout_missing) { return render(layout_engine, layout, options, locals) { output } }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="645" class="post-context"
|
|
id="post-14" onclick="toggle(14);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output.extend(ContentTyped).content_type = content_type if content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> output
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def compile_template(engine, data, options, views)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>block in render</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="204"
|
|
class="pre-context" id="pre-15"
|
|
onclick="toggle(15);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> settings.views.each do |view|
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="211" class="context" id="15"
|
|
onclick="toggle(15);">
|
|
<li class="context-line" id="context-15"><code> return super(engine, data, options.merge(:views => view), locals, &block)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="212" class="post-context"
|
|
id="post-15" onclick="toggle(15);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>each</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="200"
|
|
class="pre-context" id="pre-16"
|
|
onclick="toggle(16);">
|
|
|
|
<li class="pre-context-line"><code> haml :index, :ugly => true
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> set :views, [ File.join(Dir.pwd, 'views'), Attentive.root.join('views')]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="207" class="context" id="16"
|
|
onclick="toggle(16);">
|
|
<li class="context-line" id="context-16"><code> settings.views.each do |view|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="208" class="post-context"
|
|
id="post-16" onclick="toggle(16);">
|
|
|
|
<li class="post-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return super(engine, data, options.merge(:views => view), locals, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>render</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="200"
|
|
class="pre-context" id="pre-17"
|
|
onclick="toggle(17);">
|
|
|
|
<li class="pre-context-line"><code> haml :index, :ugly => true
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> set :views, [ File.join(Dir.pwd, 'views'), Attentive.root.join('views')]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="207" class="context" id="17"
|
|
onclick="toggle(17);">
|
|
<li class="context-line" id="context-17"><code> settings.views.each do |view|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="208" class="post-context"
|
|
id="post-17" onclick="toggle(17);">
|
|
|
|
<li class="post-context-line"><code> template = "#{data}.#{engine}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if File.file?(File.join(view, template))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return super(engine, data, options.merge(:views => view), locals, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>haml</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="525"
|
|
class="pre-context" id="pre-18"
|
|
onclick="toggle(18);">
|
|
|
|
<li class="pre-context-line"><code> def erubis(template, options={}, locals={})
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> warn "Sinatra::Templates#erubis is deprecated and will be removed, use #erb instead.\n" \
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> "If you have Erubis installed, it will be used automatically."
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> render :erubis, template, options, locals
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def haml(template, options={}, locals={})
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="532" class="context" id="18"
|
|
onclick="toggle(18);">
|
|
<li class="context-line" id="context-18"><code> render :haml, template, options, locals</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="533" class="post-context"
|
|
id="post-18" onclick="toggle(18);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def sass(template, options={}, locals={})
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> options.merge! :layout => false, :default_content_type => :css
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> render :sass, template, options, locals
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>block in <class:Sinatra></strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="193"
|
|
class="pre-context" id="pre-19"
|
|
onclick="toggle(19);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> slides.collect(&:to_html).join
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> get %r{/?\d*} do
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="200" class="context" id="19"
|
|
onclick="toggle(19);">
|
|
<li class="context-line" id="context-19"><code> haml :index, :ugly => true</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="201" class="post-context"
|
|
id="post-19" onclick="toggle(19);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> set :views, [ File.join(Dir.pwd, 'views'), Attentive.root.join('views')]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def render(engine, data, options = {}, locals = {}, &block)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> settings.views.each do |view|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="1205"
|
|
class="pre-context" id="pre-20"
|
|
onclick="toggle(20);">
|
|
|
|
<li class="pre-context-line"><code> method_name = "#{verb} #{path}"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> unbound_method = generate_method(method_name, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> pattern, keys = compile path
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> conditions, @conditions = @conditions, []
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> [ pattern, keys, conditions, block.arity != 0 ?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> proc { |a,p| unbound_method.bind(a).call(*p) } :
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="1212" class="context" id="20"
|
|
onclick="toggle(20);">
|
|
<li class="context-line" id="context-20"><code> proc { |a,p| unbound_method.bind(a).call } ]</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="1213" class="post-context"
|
|
id="post-20" onclick="toggle(20);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def compile(path)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> keys = []
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if path.respond_to? :to_str
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w]/) { |c| encoded(c) }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> pattern.gsub!(/((:\w+)|\*)/) do |match|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in compile!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="1205"
|
|
class="pre-context" id="pre-21"
|
|
onclick="toggle(21);">
|
|
|
|
<li class="pre-context-line"><code> method_name = "#{verb} #{path}"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> unbound_method = generate_method(method_name, &block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> pattern, keys = compile path
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> conditions, @conditions = @conditions, []
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> [ pattern, keys, conditions, block.arity != 0 ?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> proc { |a,p| unbound_method.bind(a).call(*p) } :
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="1212" class="context" id="21"
|
|
onclick="toggle(21);">
|
|
<li class="context-line" id="context-21"><code> proc { |a,p| unbound_method.bind(a).call } ]</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="1213" class="post-context"
|
|
id="post-21" onclick="toggle(21);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def compile(path)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> keys = []
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if path.respond_to? :to_str
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w]/) { |c| encoded(c) }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> pattern.gsub!(/((:\w+)|\*)/) do |match|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>[]</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="778"
|
|
class="pre-context" id="pre-22"
|
|
onclick="toggle(22);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="785" class="context" id="22"
|
|
onclick="toggle(22);">
|
|
<li class="context-line" id="context-22"><code> route_eval { block[*args] }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="786" class="post-context"
|
|
id="post-22" onclick="toggle(22);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block (3 levels) in route!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="778"
|
|
class="pre-context" id="pre-23"
|
|
onclick="toggle(23);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="785" class="context" id="23"
|
|
onclick="toggle(23);">
|
|
<li class="context-line" id="context-23"><code> route_eval { block[*args] }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="786" class="post-context"
|
|
id="post-23" onclick="toggle(23);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>route_eval</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="794"
|
|
class="pre-context" id="pre-24"
|
|
onclick="toggle(24);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> route_eval(&pass_block) if pass_block
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> route_missing
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run a route block and throw :halt with the result.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route_eval
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="801" class="context" id="24"
|
|
onclick="toggle(24);">
|
|
<li class="context-line" id="context-24"><code> throw :halt, yield</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="802" class="post-context"
|
|
id="post-24" onclick="toggle(24);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # If the current request matches pattern and conditions, fill params
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # with keys and call the given block.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Revert params afterwards.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Returns pass block.
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block (2 levels) in route!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="778"
|
|
class="pre-context" id="pre-25"
|
|
onclick="toggle(25);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="785" class="context" id="25"
|
|
onclick="toggle(25);">
|
|
<li class="context-line" id="context-25"><code> route_eval { block[*args] }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="786" class="post-context"
|
|
id="post-25" onclick="toggle(25);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in process_route</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="815"
|
|
class="pre-context" id="pre-26"
|
|
onclick="toggle(26);">
|
|
|
|
<li class="pre-context-line"><code> if values.any?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| (@params[k] ||= '') << v if v }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> catch(:pass) do
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="822" class="context" id="26"
|
|
onclick="toggle(26);">
|
|
<li class="context-line" id="context-26"><code> block ? block[self, values] : yield(self, values)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="823" class="post-context"
|
|
id="post-26" onclick="toggle(26);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @params = original if original
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # No matching route was found or all routes passed. The default
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # implementation is to forward the request downstream when running
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>catch</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="813"
|
|
class="pre-context" id="pre-27"
|
|
onclick="toggle(27);">
|
|
|
|
<li class="pre-context-line"><code> values += match.captures.to_a.map { |v| force_encoding URI.decode(v) if v }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if values.any?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| (@params[k] ||= '') << v if v }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="820" class="context" id="27"
|
|
onclick="toggle(27);">
|
|
<li class="context-line" id="context-27"><code> catch(:pass) do</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="821" class="post-context"
|
|
id="post-27" onclick="toggle(27);">
|
|
|
|
<li class="post-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> block ? block[self, values] : yield(self, values)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @params = original if original
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>process_route</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="813"
|
|
class="pre-context" id="pre-28"
|
|
onclick="toggle(28);">
|
|
|
|
<li class="pre-context-line"><code> values += match.captures.to_a.map { |v| force_encoding URI.decode(v) if v }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if values.any?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| (@params[k] ||= '') << v if v }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="820" class="context" id="28"
|
|
onclick="toggle(28);">
|
|
<li class="context-line" id="context-28"><code> catch(:pass) do</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="821" class="post-context"
|
|
id="post-28" onclick="toggle(28);">
|
|
|
|
<li class="post-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> block ? block[self, values] : yield(self, values)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @params = original if original
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in route!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="777"
|
|
class="pre-context" id="pre-29"
|
|
onclick="toggle(29);">
|
|
|
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="784" class="context" id="29"
|
|
onclick="toggle(29);">
|
|
<li class="context-line" id="context-29"><code> pass_block = process_route(pattern, keys, conditions) do |*args|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="785" class="post-context"
|
|
id="post-29" onclick="toggle(29);">
|
|
|
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>each</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="776"
|
|
class="pre-context" id="pre-30"
|
|
onclick="toggle(30);">
|
|
|
|
<li class="pre-context-line"><code> filter! type, base.superclass if base.superclass.respond_to?(:filters)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="783" class="context" id="30"
|
|
onclick="toggle(30);">
|
|
<li class="context-line" id="context-30"><code> routes.each do |pattern, keys, conditions, block|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="784" class="post-context"
|
|
id="post-30" onclick="toggle(30);">
|
|
|
|
<li class="post-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>route!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="776"
|
|
class="pre-context" id="pre-31"
|
|
onclick="toggle(31);">
|
|
|
|
<li class="pre-context-line"><code> filter! type, base.superclass if base.superclass.respond_to?(:filters)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block=nil)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="783" class="context" id="31"
|
|
onclick="toggle(31);">
|
|
<li class="context-line" id="context-31"><code> routes.each do |pattern, keys, conditions, block|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="784" class="post-context"
|
|
id="post-31" onclick="toggle(31);">
|
|
|
|
<li class="post-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>dispatch!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="879"
|
|
class="pre-context" id="pre-32"
|
|
onclick="toggle(32);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Dispatch a request with error handling.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def dispatch!
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> static! if settings.static? && (request.get? || request.head?)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> filter! :before
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="886" class="context" id="32"
|
|
onclick="toggle(32);">
|
|
<li class="context-line" id="context-32"><code> route!</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="887" class="post-context"
|
|
id="post-32" onclick="toggle(32);">
|
|
|
|
<li class="post-context-line"><code> rescue ::Exception => boom
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> handle_exception!(boom)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> filter! :after unless env['sinatra.static_file']
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Error handling during requests.
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in call!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="712"
|
|
class="pre-context" id="pre-33"
|
|
onclick="toggle(33);">
|
|
|
|
<li class="pre-context-line"><code> @request = Request.new(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @response = Response.new
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @params = indifferent_params(@request.params)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> template_cache.clear if settings.reload_templates
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> force_encoding(@params)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @response['Content-Type'] = nil
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="719" class="context" id="33"
|
|
onclick="toggle(33);">
|
|
<li class="context-line" id="context-33"><code> invoke { dispatch! }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="720" class="post-context"
|
|
id="post-33" onclick="toggle(33);">
|
|
|
|
<li class="post-context-line"><code> invoke { error_block!(response.status) }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> unless @response['Content-Type']
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if Array === body and body[0].respond_to? :content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> content_type body[0].content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> else
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> content_type :html
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in invoke</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="864"
|
|
class="pre-context" id="pre-34"
|
|
onclick="toggle(34);">
|
|
|
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def indifferent_hash
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def invoke
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="871" class="context" id="34"
|
|
onclick="toggle(34);">
|
|
<li class="context-line" id="context-34"><code> res = catch(:halt) { yield }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="872" class="post-context"
|
|
id="post-34" onclick="toggle(34);">
|
|
|
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> status(res.shift)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body(res.pop)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> headers(*res)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body res
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>catch</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="864"
|
|
class="pre-context" id="pre-35"
|
|
onclick="toggle(35);">
|
|
|
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def indifferent_hash
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def invoke
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="871" class="context" id="35"
|
|
onclick="toggle(35);">
|
|
<li class="context-line" id="context-35"><code> res = catch(:halt) { yield }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="872" class="post-context"
|
|
id="post-35" onclick="toggle(35);">
|
|
|
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> status(res.shift)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body(res.pop)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> headers(*res)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body res
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>invoke</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="864"
|
|
class="pre-context" id="pre-36"
|
|
onclick="toggle(36);">
|
|
|
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def indifferent_hash
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def invoke
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="871" class="context" id="36"
|
|
onclick="toggle(36);">
|
|
<li class="context-line" id="context-36"><code> res = catch(:halt) { yield }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="872" class="post-context"
|
|
id="post-36" onclick="toggle(36);">
|
|
|
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> status(res.shift)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body(res.pop)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> headers(*res)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body res
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>call!</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="712"
|
|
class="pre-context" id="pre-37"
|
|
onclick="toggle(37);">
|
|
|
|
<li class="pre-context-line"><code> @request = Request.new(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @response = Response.new
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @params = indifferent_params(@request.params)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> template_cache.clear if settings.reload_templates
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> force_encoding(@params)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @response['Content-Type'] = nil
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="719" class="context" id="37"
|
|
onclick="toggle(37);">
|
|
<li class="context-line" id="context-37"><code> invoke { dispatch! }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="720" class="post-context"
|
|
id="post-37" onclick="toggle(37);">
|
|
|
|
<li class="post-context-line"><code> invoke { error_block!(response.status) }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> unless @response['Content-Type']
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if Array === body and body[0].respond_to? :content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> content_type body[0].content_type
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> else
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> content_type :html
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="698"
|
|
class="pre-context" id="pre-38"
|
|
onclick="toggle(38);">
|
|
|
|
<li class="pre-context-line"><code> @app = app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @template_cache = Tilt::Cache.new
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> yield self if block_given?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Rack call interface.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="705" class="context" id="38"
|
|
onclick="toggle(38);">
|
|
<li class="context-line" id="context-38"><code> dup.call!(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="706" class="post-context"
|
|
id="post-38" onclick="toggle(38);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> attr_accessor :env, :request, :response, :params
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def call!(env) # :nodoc:
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @env = env
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> @request = Request.new(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="15"
|
|
class="pre-context" id="pre-39"
|
|
onclick="toggle(39);">
|
|
|
|
<li class="pre-context-line"><code> default_options :xss_mode => :block
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def header
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> { 'X-XSS-Protection' => "1; mode=#{options[:xss_mode]}" }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="22" class="context" id="39"
|
|
onclick="toggle(39);">
|
|
<li class="context-line" id="context-39"><code> status, headers, body = @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="23" class="post-context"
|
|
id="post-39" onclick="toggle(39);">
|
|
|
|
<li class="post-context-line"><code> [status, header.merge(headers), body]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="9"
|
|
class="pre-context" id="pre-40"
|
|
onclick="toggle(40);">
|
|
|
|
<li class="pre-context-line"><code> #
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Unescapes '/' and '.', expands +path_info+.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> class PathTraversal < Base
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> path_was = env["PATH_INFO"]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> env["PATH_INFO"] = cleanup path_was if path_was
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="16" class="context" id="40"
|
|
onclick="toggle(40);">
|
|
<li class="context-line" id="context-40"><code> app.call env</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="17" class="post-context"
|
|
id="post-40" onclick="toggle(40);">
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> env["PATH_INFO"] = path_was
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def cleanup(path)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> parts = []
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> unescaped = path.gsub('%2e', '.').gsub('%2f', '/')
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="10"
|
|
class="pre-context" id="pre-41"
|
|
onclick="toggle(41);">
|
|
|
|
<li class="pre-context-line"><code> # JSON GET APIs are vulnerable to being embedded as JavaScript while the
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Array prototype has been patched to track data. Checks the referrer
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # even on GET requests if the content type is JSON.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> class JsonCsrf < Base
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> default_reaction :deny
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="17" class="context" id="41"
|
|
onclick="toggle(41);">
|
|
<li class="context-line" id="context-41"><code> status, headers, body = app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="18" class="post-context"
|
|
id="post-41" onclick="toggle(41);">
|
|
|
|
<li class="post-context-line"><code> if headers['Content-Type'].to_s.split(';', 2).first =~ /^\s*application\/json\s*$/
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if referrer(env) != Request.new(env).host
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> result = react(env)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> warn env, "attack prevented by #{self.class}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> result or [status, headers, body]
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-protection-1.2.0/lib/rack/protection/base.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="40"
|
|
class="pre-context" id="pre-42"
|
|
onclick="toggle(42);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> unless accepts? env
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> warn env, "attack prevented by #{self.class}"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> result = react env
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="47" class="context" id="42"
|
|
onclick="toggle(42);">
|
|
<li class="context-line" id="context-42"><code> result or app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="48" class="post-context"
|
|
id="post-42" onclick="toggle(42);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def react(env)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> result = send(options[:reaction], env)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> result if Array === result and result.size == 3
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="15"
|
|
class="pre-context" id="pre-43"
|
|
onclick="toggle(43);">
|
|
|
|
<li class="pre-context-line"><code> default_options :xss_mode => :block
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def header
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> { 'X-XSS-Protection' => "1; mode=#{options[:xss_mode]}" }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="22" class="context" id="43"
|
|
onclick="toggle(43);">
|
|
<li class="context-line" id="context-43"><code> status, headers, body = @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="23" class="post-context"
|
|
id="post-43" onclick="toggle(43);">
|
|
|
|
<li class="post-context-line"><code> [status, header.merge(headers), body]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/logger.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="8"
|
|
class="pre-context" id="pre-44"
|
|
onclick="toggle(44);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> logger = ::Logger.new(env['rack.errors'])
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> logger.level = @level
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> env['rack.logger'] = logger
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="15" class="context" id="44"
|
|
onclick="toggle(44);">
|
|
<li class="context-line" id="context-44"><code> @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="16" class="post-context"
|
|
id="post-44" onclick="toggle(44);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/head.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="2"
|
|
class="pre-context" id="pre-45"
|
|
onclick="toggle(45);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>class Head
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def initialize(app)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @app = app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="9" class="context" id="45"
|
|
onclick="toggle(45);">
|
|
<li class="context-line" id="context-45"><code> status, headers, body = @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="10" class="post-context"
|
|
id="post-45" onclick="toggle(45);">
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if env["REQUEST_METHOD"] == "HEAD"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> [status, headers, []]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> else
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> [status, headers, body]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/showexceptions.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="14"
|
|
class="pre-context" id="pre-46"
|
|
onclick="toggle(46);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def initialize(app)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @app = app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @template = ERB.new(TEMPLATE)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="21" class="context" id="46"
|
|
onclick="toggle(46);">
|
|
<li class="context-line" id="context-46"><code> @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="22" class="post-context"
|
|
id="post-46" onclick="toggle(46);">
|
|
|
|
<li class="post-context-line"><code> rescue Exception => e
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if respond_to?(:prefers_plain_text?) and prefers_plain_text?(env)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> content_type = "text/plain"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> body = [dump_exception(e)]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> else
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>block in call</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="1327"
|
|
class="pre-context" id="pre-47"
|
|
onclick="toggle(47);">
|
|
|
|
<li class="pre-context-line"><code> setup_default_middleware builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> setup_middleware builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> builder.run new!(*args, &bk)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="1334" class="context" id="47"
|
|
onclick="toggle(47);">
|
|
<li class="context-line" id="context-47"><code> synchronize { prototype.call(env) }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="1335" class="post-context"
|
|
id="post-47" onclick="toggle(47);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def setup_default_middleware(builder)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use ShowExceptions if show_exceptions?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use Rack::MethodOverride if method_override?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use Rack::Head
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>synchronize</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="1409"
|
|
class="pre-context" id="pre-48"
|
|
onclick="toggle(48);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @@mutex = Mutex.new
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def synchronize(&block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> if lock?
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @@mutex.synchronize(&block)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> else
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="1416" class="context" id="48"
|
|
onclick="toggle(48);">
|
|
<li class="context-line" id="context-48"><code> yield</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="1417" class="post-context"
|
|
id="post-48" onclick="toggle(48);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> public
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> CALLERS_TO_IGNORE = [ # :nodoc:
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> /\/sinatra(\/(base|main|showexceptions))?\.rb$/, # all sinatra code
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> /lib\/tilt.*\.rb$/, # all tilt code
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info framework">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/sinatra-1.3.2/lib/sinatra/base.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code framework">
|
|
|
|
<ol start="1327"
|
|
class="pre-context" id="pre-49"
|
|
onclick="toggle(49);">
|
|
|
|
<li class="pre-context-line"><code> setup_default_middleware builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> setup_middleware builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> builder.run new!(*args, &bk)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> builder
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="1334" class="context" id="49"
|
|
onclick="toggle(49);">
|
|
<li class="context-line" id="context-49"><code> synchronize { prototype.call(env) }</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="1335" class="post-context"
|
|
id="post-49" onclick="toggle(49);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def setup_default_middleware(builder)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use ShowExceptions if show_exceptions?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use Rack::MethodOverride if method_override?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> builder.use Rack::Head
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="127"
|
|
class="pre-context" id="pre-50"
|
|
onclick="toggle(50);">
|
|
|
|
<li class="pre-context-line"><code> def to_app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> app = @map ? generate_map(@run, @map) : @run
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> fail "missing run or map statement" unless app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @use.reverse.inject(app) { |a,e| e[a] }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="134" class="context" id="50"
|
|
onclick="toggle(50);">
|
|
<li class="context-line" id="context-50"><code> to_app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="135" class="post-context"
|
|
id="post-50" onclick="toggle(50);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def generate_map(default_app, mapping)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> mapped = default_app ? {'/' => default_app} : {}
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> mapping.each { |r,b| mapped[r] = self.class.new(default_app, &b) }
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/urlmap.rb</code> in
|
|
<code><strong>block in call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="57"
|
|
class="pre-context" id="pre-51"
|
|
onclick="toggle(51);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> rest = m[1]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> next unless !rest || rest.empty? || rest[0] == ?/
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> env['SCRIPT_NAME'] = (script_name + location)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> env['PATH_INFO'] = rest
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="64" class="context" id="51"
|
|
onclick="toggle(51);">
|
|
<li class="context-line" id="context-51"><code> return app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="65" class="post-context"
|
|
id="post-51" onclick="toggle(51);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> [404, {"Content-Type" => "text/plain", "X-Cascade" => "pass"}, ["Not Found: #{path}"]]
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> ensure
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> env['PATH_INFO'] = path
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> env['SCRIPT_NAME'] = script_name
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/urlmap.rb</code> in
|
|
<code><strong>each</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="42"
|
|
class="pre-context" id="pre-52"
|
|
onclick="toggle(52);">
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> path = env["PATH_INFO"]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> script_name = env['SCRIPT_NAME']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> hHost = env['HTTP_HOST']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> sName = env['SERVER_NAME']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> sPort = env['SERVER_PORT']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="49" class="context" id="52"
|
|
onclick="toggle(52);">
|
|
<li class="context-line" id="context-52"><code> @mapping.each do |host, location, match, app|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="50" class="post-context"
|
|
id="post-52" onclick="toggle(52);">
|
|
|
|
<li class="post-context-line"><code> unless hHost == host \
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> || sName == host \
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> || (!host && (hHost == sName || hHost == sName+':'+sPort))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> next
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> next unless m = match.match(path.to_s)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/urlmap.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="42"
|
|
class="pre-context" id="pre-53"
|
|
onclick="toggle(53);">
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> path = env["PATH_INFO"]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> script_name = env['SCRIPT_NAME']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> hHost = env['HTTP_HOST']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> sName = env['SERVER_NAME']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> sPort = env['SERVER_PORT']
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="49" class="context" id="53"
|
|
onclick="toggle(53);">
|
|
<li class="context-line" id="context-53"><code> @mapping.each do |host, location, match, app|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="50" class="post-context"
|
|
id="post-53" onclick="toggle(53);">
|
|
|
|
<li class="post-context-line"><code> unless hHost == host \
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> || sName == host \
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> || (!host && (hHost == sName || hHost == sName+':'+sPort))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> next
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> next unless m = match.match(path.to_s)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/rack-1.4.1/lib/rack/builder.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="127"
|
|
class="pre-context" id="pre-54"
|
|
onclick="toggle(54);">
|
|
|
|
<li class="pre-context-line"><code> def to_app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> app = @map ? generate_map(@run, @map) : @run
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> fail "missing run or map statement" unless app
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> @use.reverse.inject(app) { |a,e| e[a] }
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def call(env)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="134" class="context" id="54"
|
|
onclick="toggle(54);">
|
|
<li class="context-line" id="context-54"><code> to_app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="135" class="post-context"
|
|
id="post-54" onclick="toggle(54);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> private
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def generate_map(default_app, mapping)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> mapped = default_app ? {'/' => default_app} : {}
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> mapping.each { |r,b| mapped[r] = self.class.new(default_app, &b) }
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info app">
|
|
<code>/Users/john/Projects/attentive/lib/attentive/server.rb</code> in
|
|
<code><strong>call</strong></code>
|
|
</li>
|
|
|
|
<li class="code app">
|
|
|
|
<ol start="72"
|
|
class="pre-context" id="pre-55"
|
|
onclick="toggle(55);">
|
|
|
|
<li class="pre-context-line"><code> use(*opts)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> run Attentive::Sinatra
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="79" class="context" id="55"
|
|
onclick="toggle(55);">
|
|
<li class="context-line" id="context-55"><code> @app.call(env)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="80" class="post-context"
|
|
id="post-55" onclick="toggle(55);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> class Highlight
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> attr_reader :code, :lang
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def self.run(*args)
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/Projects/attentive/bin/attentive</code> in
|
|
<code><strong>block in static</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="68"
|
|
class="pre-context" id="pre-56"
|
|
onclick="toggle(56);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.rm_rf target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.mkdir_p target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Attentive.middleware.replace([])
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> urls.each do |url|
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="75" class="context" id="56"
|
|
onclick="toggle(56);">
|
|
<li class="context-line" id="context-56"><code> response = Attentive::Server.call(Rack::MockRequest.env_for(url))</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="76" class="post-context"
|
|
id="post-56" onclick="toggle(56);">
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target = "#{target_dir}#{url}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target += "index.html" if target[-1..-1] == '/'
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> puts "Writing #{target}..."
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> FileUtils.mkdir_p(File.dirname(target))
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/Projects/attentive/bin/attentive</code> in
|
|
<code><strong>each</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="67"
|
|
class="pre-context" id="pre-57"
|
|
onclick="toggle(57);">
|
|
|
|
<li class="pre-context-line"><code> target_dir = "_site"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.rm_rf target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.mkdir_p target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Attentive.middleware.replace([])
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="74" class="context" id="57"
|
|
onclick="toggle(57);">
|
|
<li class="context-line" id="context-57"><code> urls.each do |url|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="75" class="post-context"
|
|
id="post-57" onclick="toggle(57);">
|
|
|
|
<li class="post-context-line"><code> response = Attentive::Server.call(Rack::MockRequest.env_for(url))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target = "#{target_dir}#{url}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target += "index.html" if target[-1..-1] == '/'
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> puts "Writing #{target}..."
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/Projects/attentive/bin/attentive</code> in
|
|
<code><strong>static</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="67"
|
|
class="pre-context" id="pre-58"
|
|
onclick="toggle(58);">
|
|
|
|
<li class="pre-context-line"><code> target_dir = "_site"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.rm_rf target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.mkdir_p target_dir
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> Attentive.middleware.replace([])
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="74" class="context" id="58"
|
|
onclick="toggle(58);">
|
|
<li class="context-line" id="context-58"><code> urls.each do |url|</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="75" class="post-context"
|
|
id="post-58" onclick="toggle(58);">
|
|
|
|
<li class="post-context-line"><code> response = Attentive::Server.call(Rack::MockRequest.env_for(url))
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target = "#{target_dir}#{url}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target += "index.html" if target[-1..-1] == '/'
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> puts "Writing #{target}..."
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/Projects/attentive/bin/attentive</code> in
|
|
<code><strong>gh_pages</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="84"
|
|
class="pre-context" id="pre-59"
|
|
onclick="toggle(59);">
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> FileUtils.rm_rf '.sass-cache' if File.directory?('.sass-cache')
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> desc "gh-pages", "Commit the static site to the associated GitHub pages account"
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def gh_pages
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="91" class="context" id="59"
|
|
onclick="toggle(59);">
|
|
<li class="context-line" id="context-59"><code> static</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="92" class="post-context"
|
|
id="post-59" onclick="toggle(59);">
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> target = "/tmp/attentive-#{Time.now.to_i}"
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> system %{cp -Rpv _site #{target}}
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> system %{git checkout gh-pages}
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> if $?.exitstatus == 1
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/task.rb</code> in
|
|
<code><strong>run</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="15"
|
|
class="pre-context" id="pre-60"
|
|
onclick="toggle(60);">
|
|
|
|
<li class="pre-context-line"><code> false
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # By default, a task invokes a method in the thor class. You can change this
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # implementation to create custom tasks.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def run(instance, args=[])
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> public_method?(instance) ?
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="22" class="context" id="60"
|
|
onclick="toggle(60);">
|
|
<li class="context-line" id="context-60"><code> instance.send(name, *args) : instance.class.handle_no_task_error(name)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="23" class="post-context"
|
|
id="post-60" onclick="toggle(60);">
|
|
|
|
<li class="post-context-line"><code> rescue ArgumentError => e
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> handle_argument_error?(instance, e, caller) ?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> instance.class.handle_argument_error(self, e) : (raise e)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> rescue NoMethodError => e
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> handle_no_method_error?(instance, e, caller) ?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> instance.class.handle_no_task_error(name) : (raise e)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/invocation.rb</code> in
|
|
<code><strong>invoke_task</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="111"
|
|
class="pre-context" id="pre-61"
|
|
onclick="toggle(61);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # Invoke the given task if the given args.
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def invoke_task(task, *args) #:nodoc:
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> current = @_invocations[self.class]
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> unless current.include?(task.name)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> current << task.name
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="118" class="context" id="61"
|
|
onclick="toggle(61);">
|
|
<li class="context-line" id="context-61"><code> task.run(self, *args)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="119" class="post-context"
|
|
id="post-61" onclick="toggle(61);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Invoke all tasks for the current instance.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> def invoke_all #:nodoc:
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> self.class.all_tasks.map { |_, task| invoke_task(task) }
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor.rb</code> in
|
|
<code><strong>dispatch</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="256"
|
|
class="pre-context" id="pre-62"
|
|
onclick="toggle(62);">
|
|
|
|
<li class="pre-context-line"><code> task = Thor::DynamicTask.new(meth)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> opts = given_opts || opts || []
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> config.merge!(:current_task => task, :task_options => task.options)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> trailing = args[Range.new(arguments.size, -1)]
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="263" class="context" id="62"
|
|
onclick="toggle(62);">
|
|
<li class="context-line" id="context-62"><code> new(args, opts, config).invoke_task(task, trailing || [])</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="264" class="post-context"
|
|
id="post-62" onclick="toggle(62);">
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # The banner for this class. You can customize it if you are invoking the
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # thor class by another ways which is not the Thor::Runner. It receives
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # the task that is going to be invoked and a boolean which indicates if
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # the namespace should be displayed as arguments.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/gems/thor-0.14.6/lib/thor/base.rb</code> in
|
|
<code><strong>start</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="382"
|
|
class="pre-context" id="pre-63"
|
|
onclick="toggle(63);">
|
|
|
|
<li class="pre-context-line"><code> #
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # script = MyScript.new(args, options, config)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> # script.invoke(:task, first_arg, second_arg, third_arg)
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> #
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> def start(given_args=ARGV, config={})
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> self.debugging = given_args.delete("--debug")
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> config[:shell] ||= Thor::Base.shell.new
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="389" class="context" id="63"
|
|
onclick="toggle(63);">
|
|
<li class="context-line" id="context-63"><code> dispatch(nil, given_args.dup, nil, config)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="390" class="post-context"
|
|
id="post-63" onclick="toggle(63);">
|
|
|
|
<li class="post-context-line"><code> rescue Thor::Error => e
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> debugging ? (raise e) : config[:shell].error(e.message)
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> exit(1) if exit_on_failure?
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> # Allows to use private methods from parent in child classes as tasks.
|
|
</code></li>
|
|
|
|
<li class="post-context-line"><code> #
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/Projects/attentive/bin/attentive</code> in
|
|
<code><strong><top (required)></strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="111"
|
|
class="pre-context" id="pre-64"
|
|
onclick="toggle(64);">
|
|
|
|
<li class="pre-context-line"><code> system %{git add .}
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> system %{git add *}
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> system %{git commit -a -m "Update published site"}
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> system %{git checkout master}
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="118" class="context" id="64"
|
|
onclick="toggle(64);">
|
|
<li class="context-line" id="context-64"><code>Attentive::CLI.start</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="119" class="post-context"
|
|
id="post-64" onclick="toggle(64);">
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/bin/attentive</code> in
|
|
<code><strong>load</strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="12"
|
|
class="pre-context" id="pre-65"
|
|
onclick="toggle(65);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> version = $1
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> ARGV.shift
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>gem 'attentive', version
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="19" class="context" id="65"
|
|
onclick="toggle(65);">
|
|
<li class="context-line" id="context-65"><code>load Gem.bin_path('attentive', 'attentive', version)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="20" class="post-context"
|
|
id="post-65" onclick="toggle(65);">
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="frame-info system">
|
|
<code>/Users/john/.rvm/gems/ruby-1.9.3-p125/bin/attentive</code> in
|
|
<code><strong><main></strong></code>
|
|
</li>
|
|
|
|
<li class="code system">
|
|
|
|
<ol start="12"
|
|
class="pre-context" id="pre-66"
|
|
onclick="toggle(66);">
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> version = $1
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code> ARGV.shift
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>end
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>
|
|
</code></li>
|
|
|
|
<li class="pre-context-line"><code>gem 'attentive', version
|
|
</code></li>
|
|
|
|
</ol>
|
|
|
|
|
|
<ol start="19" class="context" id="66"
|
|
onclick="toggle(66);">
|
|
<li class="context-line" id="context-66"><code>load Gem.bin_path('attentive', 'attentive', version)</code></li>
|
|
</ol>
|
|
|
|
|
|
<ol start="20" class="post-context"
|
|
id="post-66" onclick="toggle(66);">
|
|
|
|
</ol>
|
|
|
|
<div class="clear"></div>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
</div> <!-- /BACKTRACE -->
|
|
|
|
<div id="get">
|
|
<h3 id="get-info">GET</h3>
|
|
|
|
<p class="no-data">No GET data.</p>
|
|
|
|
<div class="clear"></div>
|
|
</div> <!-- /GET -->
|
|
|
|
<div id="post">
|
|
<h3 id="post-info">POST</h3>
|
|
|
|
<p class="no-data">No POST data.</p>
|
|
|
|
<div class="clear"></div>
|
|
</div> <!-- /POST -->
|
|
|
|
<div id="cookies">
|
|
<h3 id="cookie-info">COOKIES</h3>
|
|
|
|
<p class="no-data">No cookie data.</p>
|
|
|
|
<div class="clear"></div>
|
|
</div> <!-- /COOKIES -->
|
|
|
|
<div id="rack">
|
|
<h3 id="env-info">Rack ENV</h3>
|
|
<table class="req">
|
|
<tr>
|
|
<th>Variable</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>CONTENT_LENGTH</td>
|
|
<td class="code"><div>0</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>HTTPS</td>
|
|
<td class="code"><div>off</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>PATH_INFO</td>
|
|
<td class="code"><div>/</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>QUERY_STRING</td>
|
|
<td class="code"><div></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>REQUEST_METHOD</td>
|
|
<td class="code"><div>GET</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>SCRIPT_NAME</td>
|
|
<td class="code"><div></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>SERVER_NAME</td>
|
|
<td class="code"><div>example.org</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>SERVER_PORT</td>
|
|
<td class="code"><div>80</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.errors</td>
|
|
<td class="code"><div>#<Object:0x00000101971920></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.input</td>
|
|
<td class="code"><div>#<StringIO:0x00000100b3b568></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.logger</td>
|
|
<td class="code"><div>#<Logger:0x0000010099a100 @progname=nil, @level=1, @default_formatter=#<Logger::Formatter:0x0000010099a0d8 @datetime_format=nil>, @formatter=nil, @logdev=#<Logger::LogDevice:0x00000100999f20 @shift_size=nil, @shift_age=nil, @filename=nil, @dev=#<StringIO:0x00000100b3b658>, @mutex=#<Logger::LogDevice::LogDeviceMutex:0x00000100999e30 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Mutex:0x00000100999c28>>>></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.multiprocess</td>
|
|
<td class="code"><div>true</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.multithread</td>
|
|
<td class="code"><div>true</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.request.cookie_hash</td>
|
|
<td class="code"><div>{}</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.request.query_hash</td>
|
|
<td class="code"><div>{}</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.request.query_string</td>
|
|
<td class="code"><div></div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.run_once</td>
|
|
<td class="code"><div>false</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.url_scheme</td>
|
|
<td class="code"><div>http</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>rack.version</td>
|
|
<td class="code"><div>[1, 1]</div></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>sinatra.error</td>
|
|
<td class="code"><div>#<NameError: uninitialized constant Attentive::Sinatra::Pygments></div></td>
|
|
</tr>
|
|
|
|
</table>
|
|
<div class="clear"></div>
|
|
</div> <!-- /RACK ENV -->
|
|
|
|
<p id="explanation">You're seeing this error because you have
|
|
enabled the <code>show_exceptions</code> setting.</p>
|
|
</div> <!-- /WRAP -->
|
|
</body>
|
|
</html>
|