doc/files/bin/dskexplorer_rb.src/M000013.html in dsktool-0.2.1 vs doc/files/bin/dskexplorer_rb.src/M000013.html in dsktool-0.4.1
- old
+ new
@@ -8,24 +8,27 @@
<title>show_file (bin/dskexplorer.rb)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
- <pre><span class="ruby-comment cmt"># File bin/dskexplorer.rb, line 245</span>
+ <pre><span class="ruby-comment cmt"># File bin/dskexplorer.rb, line 247</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_file</span>(<span class="ruby-identifier">relative_path</span>,<span class="ruby-identifier">filename</span>,<span class="ruby-identifier">display_mode</span>)
<span class="ruby-identifier">absolute_path</span>=<span class="ruby-identifier">make_absolute_path</span>(<span class="ruby-identifier">relative_path</span>)
<span class="ruby-identifier">dsk</span>=<span class="ruby-identifier">get_dsk_from_cache</span>(<span class="ruby-identifier">absolute_path</span>)
<span class="ruby-identifier">file</span>=<span class="ruby-identifier">dsk</span>.<span class="ruby-identifier">files</span>[<span class="ruby-identifier">filename</span>]
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">then</span>
<span class="ruby-identifier">s</span>=<span class="ruby-node">"<i>#{filename} not found</i>"</span>
<span class="ruby-keyword kw">else</span>
<span class="ruby-identifier">s</span>=<span class="ruby-value str">"<hl><pre>"</span>
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">display_mode</span><span class="ruby-operator">==</span><span class="ruby-value str">"hex"</span> <span class="ruby-keyword kw">then</span>
<span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">hex_dump</span>)
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">display_mode</span><span class="ruby-operator">==</span><span class="ruby-value str">"list"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:disassembly</span>)
- <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">disassembly</span>)
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">display_mode</span><span class="ruby-operator">==</span><span class="ruby-value str">"list"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:disassembly</span>) <span class="ruby-keyword kw">then</span>
+ <span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">disassembly</span>)
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">display_mode</span><span class="ruby-operator">==</span><span class="ruby-value str">"png"</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_png</span>) <span class="ruby-keyword kw">then</span>
+ <span class="ruby-identifier">png_url</span>=<span class="ruby-node">"/png/#{uri_encode(relative_path)}?filename=#{uri_encode(filename)}"</span>
+ <span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-node">"<IMG SRC=#{png_url} HEIGHT=384 WIDTH=560>"</span>
<span class="ruby-keyword kw">else</span>
- <span class="ruby-identifier">s</span><span class="ruby-operator"><<</span> (<span class="ruby-identifier">file</span>.<span class="ruby-identifier">to_s</span>)
+ <span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-identifier">html_escape</span>(<span class="ruby-identifier">file</span>.<span class="ruby-identifier">to_s</span>)
<span class="ruby-keyword kw">end</span>
<span class="ruby-identifier">s</span><span class="ruby-operator"><<</span><span class="ruby-value str">"\n</pre><hl>"</span>
<span class="ruby-keyword kw">end</span>
<span class="ruby-identifier">s</span>
<span class="ruby-keyword kw">end</span></pre>
\ No newline at end of file