doc/Rack/RubyProf.html in ruby-prof-0.13.1 vs doc/Rack/RubyProf.html in ruby-prof-0.14.0

- old
+ new

@@ -1,166 +1,100 @@ <!DOCTYPE html> <html> <head> -<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> +<meta charset="UTF-8"> <title>class Rack::RubyProf - ruby-prof</title> -<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet"> +<link href="../fonts.css" rel="stylesheet"> +<link href="../rdoc.css" rel="stylesheet"> <script type="text/javascript"> var rdoc_rel_prefix = "../"; </script> -<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/search.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script> -<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script> +<script src="../js/jquery.js"></script> +<script src="../js/navigation.js"></script> +<script src="../js/search_index.js"></script> +<script src="../js/search.js"></script> +<script src="../js/searcher.js"></script> +<script src="../js/darkfish.js"></script> -<body id="top" class="class"> -<nav id="metadata"> - <nav id="home-section" class="section"> - <h3 class="section-header"> - <a href="../index.html">Home</a> +<body id="top" role="document" class="class"> +<nav role="navigation"> + <div id="project-navigation"> + <div id="home-section" role="region" title="Quick navigation" class="nav-section"> + <h2> + <a href="../index.html" rel="home">Home</a> + </h2> + + <div id="table-of-contents-navigation"> + <a href="../table_of_contents.html#pages">Pages</a> <a href="../table_of_contents.html#classes">Classes</a> <a href="../table_of_contents.html#methods">Methods</a> - </h3> -</nav> + </div> +</div> - - <nav id="search-section" class="section project-section" class="initially-hidden"> + <div id="search-section" role="search" class="project-section initially-hidden"> <form action="#" method="get" accept-charset="utf-8"> - <h3 class="section-header"> - <input type="text" name="search" placeholder="Search" id="search-field" + <div id="search-field-wrapper"> + <input id="search-field" role="combobox" aria-label="Search" + aria-autocomplete="list" aria-controls="search-results" + type="text" name="search" placeholder="Search" spellcheck="false" title="Type to search, Up and Down to navigate, Enter to load"> - </h3> + </div> + + <ul id="search-results" aria-label="Search Results" + aria-busy="false" aria-expanded="false" + aria-atomic="false" class="initially-hidden"></ul> </form> +</div> - <ul id="search-results" class="initially-hidden"></ul> -</nav> - - - <div id="file-metadata"> - <nav id="file-list-section" class="section"> - <h3 class="section-header">Defined In</h3> - <ul> - <li>lib/ruby-prof/rack.rb - </ul> -</nav> - - </div> + + <div id="class-metadata"> - <nav id="parent-class-section" class="section"> - <h3 class="section-header">Parent</h3> + <div id="parent-class-section" class="nav-section"> + <h3>Parent</h3> + <p class="link">Object -</nav> +</div> + <!-- Method Quickref --> -<nav id="method-list-section" class="section"> - <h3 class="section-header">Methods</h3> +<div id="method-list-section" class="nav-section"> + <h3>Methods</h3> - <ul class="link-list"> + <ul class="link-list" role="directory"> - <li><a href="#method-c-new">::new</a> + <li ><a href="#method-c-new">::new</a> - <li><a href="#method-i-call">#call</a> + <li ><a href="#method-i-call">#call</a> - <li><a href="#method-i-print">#print</a> + <li ><a href="#method-i-print">#print</a> </ul> -</nav> +</div> </div> - - <div id="project-metadata"> - <nav id="fileindex-section" class="section project-section"> - <h3 class="section-header">Pages</h3> - - <ul> - - <li class="file"><a href="../LICENSE.html">LICENSE</a> - - <li class="file"><a href="../README_rdoc.html">README</a> - - <li class="file"><a href="../examples/flat_txt.html">flat</a> - - <li class="file"><a href="../examples/graph_txt.html">graph</a> - - </ul> </nav> - <nav id="classindex-section" class="section project-section"> - <h3 class="section-header">Class and Module Index</h3> +<main role="main" aria-labelledby="class-Rack::RubyProf"> + <h1 id="class-Rack::RubyProf" class="class"> + class Rack::RubyProf + </h1> - <ul class="link-list"> - - <li><a href="../RubyProf.html">RubyProf</a> - - <li><a href="../RubyProf/AbstractPrinter.html">RubyProf::AbstractPrinter</a> - - <li><a href="../RubyProf/AggregateCallInfo.html">RubyProf::AggregateCallInfo</a> - - <li><a href="../RubyProf/CallInfo.html">RubyProf::CallInfo</a> - - <li><a href="../RubyProf/CallInfoPrinter.html">RubyProf::CallInfoPrinter</a> - - <li><a href="../RubyProf/CallInfoVisitor.html">RubyProf::CallInfoVisitor</a> - - <li><a href="../RubyProf/CallStackPrinter.html">RubyProf::CallStackPrinter</a> - - <li><a href="../RubyProf/CallTreePrinter.html">RubyProf::CallTreePrinter</a> - - <li><a href="../RubyProf/Cmd.html">RubyProf::Cmd</a> - - <li><a href="../RubyProf/DotPrinter.html">RubyProf::DotPrinter</a> - - <li><a href="../RubyProf/FlatPrinter.html">RubyProf::FlatPrinter</a> - - <li><a href="../RubyProf/FlatPrinterWithLineNumbers.html">RubyProf::FlatPrinterWithLineNumbers</a> - - <li><a href="../RubyProf/GraphHtmlPrinter.html">RubyProf::GraphHtmlPrinter</a> - - <li><a href="../RubyProf/GraphPrinter.html">RubyProf::GraphPrinter</a> - - <li><a href="../RubyProf/MethodInfo.html">RubyProf::MethodInfo</a> - - <li><a href="../RubyProf/MultiPrinter.html">RubyProf::MultiPrinter</a> - - <li><a href="../RubyProf/Profile.html">RubyProf::Profile</a> - - <li><a href="../RubyProf/ProfileTask.html">RubyProf::ProfileTask</a> - - <li><a href="../RubyProf/Test.html">RubyProf::Test</a> - - <li><a href="../RubyProf/Thread.html">RubyProf::Thread</a> - - <li><a href="../Rack.html">Rack</a> - - <li><a href="../Rack/RubyProf.html">Rack::RubyProf</a> - - </ul> -</nav> - - </div> -</nav> - -<div id="documentation"> - <h1 class="class">class Rack::RubyProf</h1> - - <div id="description" class="description"> + <section class="description"> - </div><!-- description --> + </section> <section id="5Buntitled-5D" class="documentation-section"> @@ -170,150 +104,161 @@ - <!-- Methods --> - <section id="public-class-5Buntitled-5D-method-details" class="method-section section"> - <h3 class="section-header">Public Class Methods</h3> + <section id="public-class-5Buntitled-5D-method-details" class="method-section"> + <header> + <h3>Public Class Methods</h3> + </header> <div id="method-c-new" class="method-detail "> <div class="method-heading"> <span class="method-name">new</span><span class="method-args">(app, options = {})</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="new-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 5</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {}) - <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span> - <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span> - <span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span> - <span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span> - <span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;flat.txt&#39;</span>, - <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;graph.txt&#39;</span>, - <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;graph.html&#39;</span>, - <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;call_stack.html&#39;</span>} - - <span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>] +<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">options</span> = {}) + <span class="ruby-ivar">@app</span> = <span class="ruby-identifier">app</span> + <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span> + <span class="ruby-ivar">@options</span>[<span class="ruby-value">:min_percent</span>] <span class="ruby-operator">||=</span> <span class="ruby-value">1</span> + <span class="ruby-ivar">@tmpdir</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span> + <span class="ruby-ivar">@printer_klasses</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-value">:printers</span>] <span class="ruby-operator">||</span> {<span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">FlatPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;flat.txt&#39;</span>, + <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;graph.txt&#39;</span>, + <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">GraphHtmlPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;graph.html&#39;</span>, + <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">CallStackPrinter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;call_stack.html&#39;</span>} + + <span class="ruby-ivar">@skip_paths</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:skip_paths</span>] <span class="ruby-operator">||</span> [<span class="ruby-regexp">%r{^/assets}</span>, <span class="ruby-regexp">%r{\.css$}</span>, <span class="ruby-regexp">%r{\.js$}</span>, <span class="ruby-regexp">%r{\.png$}</span>, <span class="ruby-regexp">%r{\.jpeg$}</span>, <span class="ruby-regexp">%r{\.jpg$}</span>, <span class="ruby-regexp">%r{\.gif$}</span>] <span class="ruby-keyword">end</span></pre> - </div><!-- new-source --> + </div> </div> - </div><!-- new-method --> + </div> - </section><!-- public-class-method-details --> + </section> - <section id="public-instance-5Buntitled-5D-method-details" class="method-section section"> - <h3 class="section-header">Public Instance Methods</h3> + <section id="public-instance-5Buntitled-5D-method-details" class="method-section"> + <header> + <h3>Public Instance Methods</h3> + </header> <div id="method-i-call" class="method-detail "> <div class="method-heading"> <span class="method-name">call</span><span class="method-args">(env)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="call-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 18</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) - <span class="ruby-identifier">request</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>) - - <span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_paths</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">skip_path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">skip_path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>} - <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) - <span class="ruby-keyword">else</span> - <span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span> - <span class="ruby-identifier">data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span> - <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) - <span class="ruby-keyword">end</span> - - <span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&#39;/&#39;</span>, <span class="ruby-string">&#39;-&#39;</span>) - <span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>) - - <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>) - <span class="ruby-identifier">result</span> - <span class="ruby-keyword">end</span> +<span class="ruby-keyword">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) + <span class="ruby-identifier">request</span> = <span class="ruby-constant">Rack</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>) + + <span class="ruby-keyword">if</span> <span class="ruby-ivar">@skip_paths</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">skip_path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">skip_path</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>} + <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) + <span class="ruby-keyword">else</span> + <span class="ruby-identifier">result</span> = <span class="ruby-keyword">nil</span> + <span class="ruby-identifier">data</span> = <span class="ruby-operator">::</span><span class="ruby-constant">RubyProf</span><span class="ruby-operator">::</span><span class="ruby-constant">Profile</span>.<span class="ruby-identifier">profile</span> <span class="ruby-keyword">do</span> + <span class="ruby-identifier">result</span> = <span class="ruby-ivar">@app</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">env</span>) + <span class="ruby-keyword">end</span> + + <span class="ruby-identifier">path</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">&#39;/&#39;</span>, <span class="ruby-string">&#39;-&#39;</span>) + <span class="ruby-identifier">path</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>) + + <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>) + <span class="ruby-identifier">result</span> + <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- call-source --> + </div> </div> - </div><!-- call-method --> + </div> <div id="method-i-print" class="method-detail "> <div class="method-heading"> <span class="method-name">print</span><span class="method-args">(data, path)</span> + <span class="method-click-advice">click to toggle source</span> + </div> <div class="method-description"> + <div class="method-source-code" id="print-source"> <pre><span class="ruby-comment"># File lib/ruby-prof/rack.rb, line 37</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>) - <span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>) - <span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">&quot;#{path}-#{base_name}&quot;</span>) - <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">&#39;wb&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>) - <span class="ruby-keyword">end</span> - <span class="ruby-keyword">end</span> +<span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">data</span>, <span class="ruby-identifier">path</span>) + <span class="ruby-ivar">@printer_klasses</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">printer_klass</span>, <span class="ruby-identifier">base_name</span><span class="ruby-operator">|</span> + <span class="ruby-identifier">printer</span> = <span class="ruby-identifier">printer_klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">data</span>) + <span class="ruby-identifier">file_name</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@tmpdir</span>, <span class="ruby-node">&quot;#{path}-#{base_name}&quot;</span>) + <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file_name</span>, <span class="ruby-string">&#39;wb&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> + <span class="ruby-identifier">printer</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">file</span>, <span class="ruby-ivar">@options</span>) + <span class="ruby-keyword">end</span> + <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> - </div><!-- print-source --> + </div> </div> - </div><!-- print-method --> + </div> - </section><!-- public-instance-method-details --> + </section> - </section><!-- 5Buntitled-5D --> + </section> +</main> -</div><!-- documentation --> - -<footer id="validator-badges"> - <p><a href="http://validator.w3.org/check/referer">[Validate]</a> - <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.1. - <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3. +<footer id="validator-badges" role="contentinfo"> + <p><a href="http://validator.w3.org/check/referer">Validate</a> + <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0. + <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>. </footer>