doc/classes/FileCache.src/M000529.html in ripxplore-0.17.0 vs doc/classes/FileCache.src/M000529.html in ripxplore-0.17.1
- old
+ new
@@ -3,24 +3,18 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>cache_name_for_url (FileCache)</title>
+ <title>cache_name_for_native_file (FileCache)</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/FileCache.rb, line 22</span>
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name_for_url</span>(<span class="ruby-identifier">url</span>)
- <span class="ruby-keyword kw">if</span> ( <span class="ruby-identifier">url</span><span class="ruby-operator">=~</span><span class="ruby-regexp re">/^file:/</span>) <span class="ruby-keyword kw">then</span>
- <span class="ruby-identifier">local_name</span>=<span class="ruby-constant">CGI</span>.<span class="ruby-identifier">unescape</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/file:\/+/</span>,<span class="ruby-value str">""</span>))
- <span class="ruby-identifier">local_name</span>=<span class="ruby-node">"#{File::Separator}#{local_name}"</span> <span class="ruby-keyword kw">unless</span> ((<span class="ruby-identifier">local_name</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">chr</span><span class="ruby-operator">==</span><span class="ruby-value str">':'</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">local_name</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">chr</span><span class="ruby-operator">==</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">Separator</span>))
- <span class="ruby-comment cmt"># puts "#{url}->#{local_name}"
</span>
- <span class="ruby-identifier">local_name</span>
-
- <span class="ruby-keyword kw">else</span>
- <span class="ruby-node">"#{url_cache_dir}/#{Digest::MD5.hexdigest(url)}.cached"</span>
- <span class="ruby-keyword kw">end</span>
+ <pre><span class="ruby-comment cmt"># File lib/FileCache.rb, line 34</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cache_name_for_native_file</span>(<span class="ruby-identifier">native_file</span>,<span class="ruby-identifier">extension</span>)
+ <span class="ruby-identifier">image</span>=<span class="ruby-identifier">native_file</span>.<span class="ruby-identifier">file_system_image</span>
+ <span class="ruby-identifier">index</span>=<span class="ruby-identifier">image</span>.<span class="ruby-identifier">files</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">native_file</span>)
+ <span class="ruby-node">"#{native_file_cache_dir}/#{Digest::MD5.hexdigest(image.filename)}-#{index}.#{extension}"</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file