diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-08-11 00:30:34 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-08-11 00:30:34 -0400 |
commit | d64ce278f01cafc1c3c23aec9bb2394412ad160b (patch) | |
tree | 8a089d44a15dbef0a2ba14c649e82120716ccb72 /Zip.html | |
parent | 055abed0e28681387377671bc16d40d075e3aaf7 (diff) | |
download | zip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.tar.bz2 zip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.zip |
update documentation
Diffstat (limited to 'Zip.html')
-rw-r--r-- | Zip.html | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -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> @@ -124,7 +144,7 @@ mem_io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k"> <span class="c"># read from "foo.zip"</span> <span class="t">Zip</span>.read(<span class="s">"foo.zip"</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> <span class="c"># read contents of "bar.txt" in "foo.zip" into mem_io</span> - zip[<span class="s">"bar.txt"</span>].read(mem_io) + zip[<span class="s">"bar.txt"</span>].write(mem_io) <span class="k">end</span></code></pre> <p>Writing to a zip file:</p> @@ -260,7 +280,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># extract "bar.txt" from zip archive in Slice some_slice and</span> <span class="c"># save it to MemoryIO</span> <span class="t">Zip</span>.read(some_slice) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> @@ -286,7 +306,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># extract "bar.txt" from "foo.zip" and save it to MemoryIO</span> <span class="t">Zip</span>.read(<span class="s">"foo.zip"</span>) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> @@ -313,7 +333,7 @@ io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new< <span class="c"># read "bar.txt" from "foo.zip"</span> <span class="t">Zip</span>.read(<span class="t">File</span>.open(<span class="s">"foo.zip"</span>, <span class="s">"rb"</span>)) <span class="k">do</span> <span class="o">|</span>zip<span class="o">|</span> - zip[<span class="s">"bar.txt"</span>].read(io) + zip[<span class="s">"bar.txt"</span>].write(io) <span class="k">end</span></code></pre></div> <br/> |