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

- old
+ new

@@ -198,14 +198,14 @@ <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">'flat.txt'</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">'graph.txt'</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">'graph.html'</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">'call_stack.html'</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 --> @@ -249,11 +249,11 @@ <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">'/'</span>, <span class="ruby-string">'-'</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> @@ -287,10 +287,10 @@ <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">'wb'</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-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 -->