doc/RubyProf/GraphHtmlPrinter.html in ruby-prof-0.16.2 vs doc/RubyProf/GraphHtmlPrinter.html in ruby-prof-0.17.0

- old
+ new

@@ -6,10 +6,11 @@ <title>class RubyProf::GraphHtmlPrinter - ruby-prof</title> <script type="text/javascript"> var rdoc_rel_prefix = "../"; + var index_rel_prefix = "../"; </script> <script src="../js/jquery.js"></script> <script src="../js/darkfish.js"></script> @@ -120,12 +121,16 @@ <pre>:filename - specify a file to use that contains the ERB template to use, instead of the built-in self.template :template - specify an ERB template to use, instead of the - built-in self.template</pre> + built-in self.template + :editor_uri - Specifies editor uri scheme used for opening files + e.g. :atm or :mvim. For OS X default is :txmt. + Use RUBY_PROF_EDITOR_URI environment variable to overide.</pre> + </section> @@ -164,11 +169,11 @@ <div class="method-source-code" id="create_link-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 45</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 49</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">create_link</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">overall_time</span>, <span class="ruby-identifier">method</span>) <span class="ruby-identifier">total_percent</span> = (<span class="ruby-identifier">method</span>.<span class="ruby-identifier">total_time</span><span class="ruby-operator">/</span><span class="ruby-identifier">overall_time</span>) <span class="ruby-operator">*</span> <span class="ruby-value">100</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">total_percent</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">min_percent</span> <span class="ruby-comment"># Just return name</span> <span class="ruby-identifier">h</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span> @@ -204,18 +209,18 @@ <div class="method-source-code" id="file_link-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 64</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">file_link</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">linenum</span>) <span class="ruby-identifier">srcfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">srcfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\/ruby_runtime$/</span> <span class="ruby-string">&quot;&quot;</span> <span class="ruby-keyword">else</span> - <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/darwin/</span> - <span class="ruby-node">&quot;&lt;a href=\&quot;txmt://open?url=file://#{h srcfile}&amp;line=#{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span> + <span class="ruby-keyword">if</span> <span class="ruby-ivar">@editor</span> + <span class="ruby-node">&quot;&lt;a href=\&quot;#{@editor}://&quot;</span> <span class="ruby-node">&quot;open?url=file://#{h srcfile}&amp;line=#{linenum}\&quot;&quot;</span> <span class="ruby-node">&quot;title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span> <span class="ruby-keyword">else</span> <span class="ruby-node">&quot;&lt;a href=\&quot;file://#{h srcfile}##{linenum}\&quot; title=\&quot;#{h srcfile}:#{linenum}\&quot;&gt;#{linenum}&lt;/a&gt;&quot;</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span> <span class="ruby-keyword">end</span></pre> @@ -246,11 +251,11 @@ <div class="method-source-code" id="method_href-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 56</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 60</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">method_href</span>(<span class="ruby-identifier">thread</span>, <span class="ruby-identifier">method</span>) <span class="ruby-identifier">h</span>(<span class="ruby-identifier">method</span>.<span class="ruby-identifier">full_name</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/[&gt;&lt;#\.\?=:]/</span>,<span class="ruby-string">&quot;_&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">thread</span>.<span class="ruby-identifier">fiber_id</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword">end</span></pre> </div> @@ -279,14 +284,15 @@ <div class="method-source-code" id="print-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 35</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 38</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">print</span>(<span class="ruby-identifier">output</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">options</span> = {}) <span class="ruby-ivar">@output</span> = <span class="ruby-identifier">output</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>) + <span class="ruby-ivar">@editor</span> = <span class="ruby-identifier">editor_uri</span> <span class="ruby-ivar">@output</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>).<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:rstrip</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;\n&quot;</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;\n&quot;</span> <span class="ruby-keyword">end</span></pre> </div> </div> @@ -319,11 +325,11 @@ </div> <div class="method-source-code" id="setup_options-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 26</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 29</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">setup_options</span>(<span class="ruby-identifier">options</span>) <span class="ruby-keyword">super</span>(<span class="ruby-identifier">options</span>) <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value">:filename</span>] <span class="ruby-identifier">template</span> = <span class="ruby-identifier">filename</span> <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">filename</span>).<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">options</span>[<span class="ruby-value">:template</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">template</span>) @@ -357,11 +363,11 @@ <div class="method-source-code" id="template-source"> - <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 73</span> + <pre><span class="ruby-comment"># File lib/ruby-prof/printers/graph_html_printer.rb, line 79</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span> <span class="ruby-string">&#39; &lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt; &lt;html&gt; &lt;head&gt; @@ -481,12 +487,12 @@ &lt;td class=&quot;method_name&quot;&gt;&lt;%= create_link(thread, total_time, caller.parent.target) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= file_link(caller.parent.target.source_file, caller.line) %&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% end %&gt; &lt;tr class=&quot;method&quot;&gt; - &lt;td&gt;&lt;%= sprintf(&quot;%.2f\%&quot;, total_percentage) %&gt;&lt;/td&gt; - &lt;td&gt;&lt;%= sprintf(&quot;%.2f\%&quot;, self_percentage) %&gt;&lt;/td&gt; + &lt;td&gt;&lt;%= sprintf(&quot;%.2f%%&quot;, total_percentage) %&gt;&lt;/td&gt; + &lt;td&gt;&lt;%= sprintf(&quot;%.2f%%&quot;, self_percentage) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sprintf(&quot;%.2f&quot;, method.total_time) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sprintf(&quot;%.2f&quot;, method.self_time) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sprintf(&quot;%.2f&quot;, method.wait_time) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sprintf(&quot;%.2f&quot;, method.children_time) %&gt;&lt;/td&gt; &lt;td&gt;&lt;%= sprintf(&quot;%i&quot;, method.called) %&gt;&lt;/td&gt; @@ -544,9 +550,9 @@ </main> <footer id="validator-badges" role="contentinfo"> <p><a href="http://validator.w3.org/check/referer">Validate</a> - <p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.2. + <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> 5.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>