summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html39
1 files changed, 28 insertions, 11 deletions
diff --git a/index.html b/index.html
index 0314d29..264d607 100644
--- a/index.html
+++ b/index.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>
@@ -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 &quot;/some/other/path/image.png&quot; for writing</span>
-<span class="t">File</span>.open(<span class="s">&quot;/some/other/path/image.png&quot;</span>, <span class="s">&quot;wb&quot;</span>) <span class="k">do</span> <span class="o">|</span>file_io<span class="o">|</span>
- <span class="c"># read from &quot;foo.zip&quot;</span>
- <span class="t">Zip</span>.read(<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"># extract &quot;bar.txt&quot; to mem_io</span>
- zip[<span class="s">&quot;bar.txt&quot;</span>].read(mem_io)
+<span class="c"># read from &quot;foo.zip&quot;</span>
+<span class="t">Zip</span>.read(<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"># extract &quot;bar.txt&quot; to mem_io</span>
+ zip[<span class="s">&quot;bar.txt&quot;</span>].write(mem_io)
- <span class="c"># extract &quot;image.png&quot; to file_io</span>
- zip[<span class="s">&quot;image.png&quot;</span>].read(file_io)
- <span class="k">end</span>
+ <span class="c"># extract &quot;image.png&quot; to &quot;output-image.png&quot;</span>
+ zip[<span class="s">&quot;image.png&quot;</span>].write(<span class="s">&quot;output-image.png&quot;</span>)
<span class="k">end</span></code></pre>
<p>See the <a href="https://pablotron.github.com/zip-crystal/" target="_blank">API documentation</a>