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 /index.html | |
parent | 055abed0e28681387377671bc16d40d075e3aaf7 (diff) | |
download | zip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.tar.bz2 zip-crystal-d64ce278f01cafc1c3c23aec9bb2394412ad160b.zip |
update documentation
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 39 |
1 files changed, 28 insertions, 11 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> @@ -129,16 +149,13 @@ <span class="c"># create memory io</span> mem_io <span class="o">=</span> <span class="t">MemoryIO</span>.<span class="k">new</span> -<span class="c"># open "/some/other/path/image.png" for writing</span> -<span class="t">File</span>.open(<span class="s">"/some/other/path/image.png"</span>, <span class="s">"wb"</span>) <span class="k">do</span> <span class="o">|</span>file_io<span class="o">|</span> - <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"># extract "bar.txt" to mem_io</span> - zip[<span class="s">"bar.txt"</span>].read(mem_io) +<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"># extract "bar.txt" to mem_io</span> + zip[<span class="s">"bar.txt"</span>].write(mem_io) - <span class="c"># extract "image.png" to file_io</span> - zip[<span class="s">"image.png"</span>].read(file_io) - <span class="k">end</span> + <span class="c"># extract "image.png" to "output-image.png"</span> + zip[<span class="s">"image.png"</span>].write(<span class="s">"output-image.png"</span>) <span class="k">end</span></code></pre> <p>See the <a href="https://pablotron.github.com/zip-crystal/" target="_blank">API documentation</a> |