doc/classes/AppleText.src/M000053.html in ripxplore-0.17.0 vs doc/classes/AppleText.src/M000053.html in ripxplore-0.17.1
- old
+ new
@@ -3,18 +3,21 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>to_text (AppleText)</title>
+ <title>text_for_screendump (AppleText)</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 lib/native_file_types/apple2/AppleText.rb, line 17</span>
-<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_text</span>
- <span class="ruby-identifier">s</span>=<span class="ruby-value str">""</span>
- <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">each_byte</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span><span class="ruby-constant">Apple2</span>.<span class="ruby-identifier">to_ascii</span>(<span class="ruby-identifier">b</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">b</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>}
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">"\r"</span>,<span class="ruby-value str">"\n"</span>)
+ <pre><span class="ruby-comment cmt"># File lib/native_file_types/apple2/AppleText.rb, line 23</span>
+<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_for_screendump</span>
+ <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">file_system</span>.<span class="ruby-identifier">to_s</span><span class="ruby-operator">==</span><span class="ruby-identifier">:ProDos</span>.<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">then</span>
+ <span class="ruby-identifier">s</span>=<span class="ruby-value str">""</span>
+ <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">each_byte</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span><span class="ruby-operator">+=</span> ((<span class="ruby-identifier">b</span><span class="ruby-operator">+</span><span class="ruby-value">128</span>)<span class="ruby-operator">%</span><span class="ruby-value">256</span>).<span class="ruby-identifier">chr</span>}
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">s</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-identifier">data_without_header</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/\000*$/</span>,<span class="ruby-value str">''</span>) <span class="ruby-comment cmt">#trim of any trailing null bytes
</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file