summaryrefslogtreecommitdiff
path: root/Zip/Writer.html
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-08-11 00:30:34 -0400
committerPaul Duncan <pabs@pablotron.org>2016-08-11 00:30:34 -0400
commitd64ce278f01cafc1c3c23aec9bb2394412ad160b (patch)
tree8a089d44a15dbef0a2ba14c649e82120716ccb72 /Zip/Writer.html
parent055abed0e28681387377671bc16d40d075e3aaf7 (diff)
downloadzip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.tar.bz2
zip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.zip
update documentation
Diffstat (limited to 'Zip/Writer.html')
-rw-r--r--Zip/Writer.html63
1 files changed, 61 insertions, 2 deletions
diff --git a/Zip/Writer.html b/Zip/Writer.html
index 894055d..0b4a935 100644
--- a/Zip/Writer.html
+++ b/Zip/Writer.html
@@ -85,8 +85,28 @@
</li>
- <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/WriterEntry" data-name="zip::writerentry">
- <a href="../Zip/WriterEntry.html">WriterEntry</a>
+ <li class="parent " data-id="github.com/pablotron/zip-crystal/Zip/Writers" data-name="zip::writers">
+ <a href="../Zip/Writers.html">Writers</a>
+
+ <ul>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/DirEntry" data-name="zip::writers::direntry">
+ <a href="../Zip/Writers/DirEntry.html">DirEntry</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/FileEntry" data-name="zip::writers::fileentry">
+ <a href="../Zip/Writers/FileEntry.html">FileEntry</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writers/WriterEntry" data-name="zip::writers::writerentry">
+ <a href="../Zip/Writers/WriterEntry.html">WriterEntry</a>
+
+ </li>
+
+</ul>
+
</li>
@@ -112,6 +132,13 @@
+ <h2>Overview</h2>
+
+ <p>Zip file writer.</p>
+
+<p>You shouldn't need to instantiate this class directly; use
+<code><a href="../Zip.html#write%28io%3AIO%2Cpos%3AUInt32%3D%3Cspanclass%3D%22n%22%3E0_u32%3C%2Fspan%3E%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%2Cversion%3AVersion%3D%3Cspanclass%3D%22t%22%3EVersion%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3EDEFAULT%3C%2Fspan%3E%2C%26cb%3AWriter-%3E%29%3AUInt32-class-method">Zip.write</a>()</code> instead.</p>
+
@@ -164,6 +191,13 @@
</li>
<li class="entry-summary">
+ <a href="#add_dir%28path%3AString%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method" class="signature"><strong>#add_dir</strong>(path : String, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">&quot;&quot;</span>) : UInt32</a>
+
+ <div class="summary"><p>Add empty directory to archive as <em>path</em> and return number of bytes written.</p></div>
+
+ </li>
+
+ <li class="entry-summary">
<a href="#add_file%28path%3AString%2Cfile_path%3AString%2Cmethod%3ACompressionMethod%3D%3Cspanclass%3D%22t%22%3ECompressionMethod%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3E%3A%3A%3C%2Fspan%3E%3Cspanclass%3D%22t%22%3EDEFLATE%3C%2Fspan%3E%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method" class="signature"><strong>#add_file</strong>(path : String, file_path : String, method : CompressionMethod = <span class="t">CompressionMethod</span><span class="t">::</span><span class="t">DEFLATE</span>, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">&quot;&quot;</span>) : UInt32</a>
<div class="summary"><p>Add local file <em>file_path</em> to archive as <em>path</em> and return number of bytes written.</p></div>
@@ -295,6 +329,31 @@ written.</p>
</div>
</div>
+ <div class="entry-detail" id="add_dir&#40;path:String,time:Time&#61;&lt;spanclass&#61;&quot;t&quot;&gt;Time&lt;/span&gt;.now,comment:String&#61;&lt;spanclass&#61;&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&#41;:UInt32-instance-method">
+ <div class="signature">
+
+ def <strong>add_dir</strong>(path : String, time : Time = <span class="t">Time</span>.now, comment : String = <span class="s">&quot;&quot;</span>) : UInt32
+
+ <a class="method-permalink" href="#add_dir%28path%3AString%2Ctime%3ATime%3D%3Cspanclass%3D%22t%22%3ETime%3C%2Fspan%3E.now%2Ccomment%3AString%3D%3Cspanclass%3D%22s%22%3E%26quot%3B%26quot%3B%3C%2Fspan%3E%29%3AUInt32-instance-method">#</a>
+ </div>
+
+ <div class="doc"><p>Add empty directory to archive as <em>path</em> and return number of
+bytes written.</p>
+
+<p>Example:</p>
+
+<pre><code><span class="c"># write to &quot;foo.zip&quot;</span>
+<span class="t">Zip</span>.write(<span class="s">&quot;foo.zip&quot;</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span>
+ <span class="c"># add a directory named &quot;example-dir&quot;</span>
+ zip.add_dir(<span class="s">&quot;example-dir&quot;</span>)
+<span class="k">end</span></code></pre></div>
+
+ <br/>
+ <div>
+
+ </div>
+ </div>
+
<div class="entry-detail" id="add_file&#40;path:String,file_path:String,method:CompressionMethod&#61;&lt;spanclass&#61;&quot;t&quot;&gt;CompressionMethod&lt;/span&gt;&lt;spanclass&#61;&quot;t&quot;&gt;::&lt;/span&gt;&lt;spanclass&#61;&quot;t&quot;&gt;DEFLATE&lt;/span&gt;,time:Time&#61;&lt;spanclass&#61;&quot;t&quot;&gt;Time&lt;/span&gt;.now,comment:String&#61;&lt;spanclass&#61;&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&#41;:UInt32-instance-method">
<div class="signature">