rdoc/RubyXL/GenericStorageObject.html in rubyXL-3.0.0 vs rdoc/RubyXL/GenericStorageObject.html in rubyXL-3.0.1

- old
+ new

@@ -2,11 +2,11 @@ <html> <head> <meta charset="UTF-8"> -<title>class RubyXL::GenericStorageObject - rubyXL 3.0.0</title> +<title>class RubyXL::GenericStorageObject - rubyXL 3.0.1</title> <link href="../fonts.css" rel="stylesheet"> <link href="../rdoc.css" rel="stylesheet"> <script type="text/javascript"> @@ -237,11 +237,11 @@ <span class="ruby-keyword">case</span> <span class="ruby-identifier">dirpath</span> <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">full_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dirpath</span>, <span class="ruby-identifier">file_path</span>) <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">full_path</span>) - <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">data</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path</span>, <span class="ruby-string">&#39;r&#39;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> } + <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">data</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">full_path</span>, <span class="ruby-string">'r'</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> } <span class="ruby-keyword">when</span> <span class="ruby-constant">Zip</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">dirpath</span>.<span class="ruby-identifier">find_entry</span>(<span class="ruby-identifier">file_path</span>) <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">data</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">get_input_stream</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> } <span class="ruby-keyword">end</span> @@ -322,10 +322,10 @@ <pre><span class="ruby-comment"># File lib/rubyXL/objects/storage.rb, line 37</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier">add_to_zip</span>(<span class="ruby-identifier">zipfile</span>) <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-identifier">path</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">xlsx_path</span> - <span class="ruby-identifier">path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;/&quot;</span>)) <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">absolute?</span> <span class="ruby-comment"># Zip doesn&#39;t like absolute paths. </span> + <span class="ruby-identifier">path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">relative_path_from</span>(<span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;/&quot;</span>)) <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">absolute?</span> <span class="ruby-comment"># Zip doesn't like absolute paths. </span> <span class="ruby-identifier">zipfile</span>.<span class="ruby-identifier">get_output_stream</span>(<span class="ruby-identifier">path</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@data</span> } <span class="ruby-keyword">end</span></pre> </div>