aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html160
1 files changed, 160 insertions, 0 deletions
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..0314d29
--- /dev/null
+++ b/index.html
@@ -0,0 +1,160 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8" />
+ <meta id="repository-name" content="github.com/pablotron/zip-crystal">
+ <link href="css/style.css" rel="stylesheet" type="text/css" />
+ <script type="text/javascript" src="js/doc.js"></script>
+ <title>README - github.com/pablotron/zip-crystal</title>
+</head>
+<body>
+
+<div id="types-list">
+ <div id="search-box">
+ <input type="search" id="search-input" placeholder="Search...">
+ </div>
+
+ <ul>
+ <li class="current"><a href="index.html">README</a></li>
+ </ul>
+
+ <ul>
+
+ <li class="parent " data-id="github.com/pablotron/zip-crystal/Zip" data-name="zip">
+ <a href="Zip.html">Zip</a>
+
+ <ul>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Archive" data-name="zip::archive">
+ <a href="Zip/Archive.html">Archive</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/CompressionMethod" data-name="zip::compressionmethod">
+ <a href="Zip/CompressionMethod.html">CompressionMethod</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/DeflateCompressionHelper" data-name="zip::deflatecompressionhelper">
+ <a href="Zip/DeflateCompressionHelper.html">DeflateCompressionHelper</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Entry" data-name="zip::entry">
+ <a href="Zip/Entry.html">Entry</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Error" data-name="zip::error">
+ <a href="Zip/Error.html">Error</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Extra" data-name="zip::extra">
+ <a href="Zip/Extra.html">Extra</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/GeneralFlags" data-name="zip::generalflags">
+ <a href="Zip/GeneralFlags.html">GeneralFlags</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/NoneCompressionHelper" data-name="zip::nonecompressionhelper">
+ <a href="Zip/NoneCompressionHelper.html">NoneCompressionHelper</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Source" data-name="zip::source">
+ <a href="Zip/Source.html">Source</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/TimeHelper" data-name="zip::timehelper">
+ <a href="Zip/TimeHelper.html">TimeHelper</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Version" data-name="zip::version">
+ <a href="Zip/Version.html">Version</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/Writer" data-name="zip::writer">
+ <a href="Zip/Writer.html">Writer</a>
+
+ </li>
+
+ <li class=" " data-id="github.com/pablotron/zip-crystal/Zip/WriterEntry" data-name="zip::writerentry">
+ <a href="Zip/WriterEntry.html">WriterEntry</a>
+
+ </li>
+
+</ul>
+
+
+ </li>
+
+</ul>
+
+</div>
+
+<div id="main-content">
+<h1>zip-crystal</h1>
+
+<p>Read and write zip archives natively from
+<a href="http://crystal-lang.org/" target="_blank">Crystal</a>.</p>
+
+<h2>Installation</h2>
+
+<p>Add this to your application's <code>shard.yml</code>:</p>
+
+<pre><code class='language-yaml'>dependencies:
+ zip-crystal:
+ github: pablotron/zip-crystal</code></pre>
+
+<h2>Usage</h2>
+
+<pre><code class='language-crystal'><span class="k">require</span> <span class="s">&quot;zip-crystal/zip&quot;</span>
+
+<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 &quot;bar.txt&quot; with contents &quot;hello&#33;&quot;</span>
+ zip.add(<span class="s">&quot;bar.txt&quot;</span>, <span class="s">&quot;hello&#33;&quot;</span>)
+
+ <span class="c"># add local file &quot;/path/to/image.png&quot; as &quot;image.png&quot;</span>
+ zip.add_file(<span class="s">&quot;image.png&quot;</span>, <span class="s">&quot;/path/to/image.png&quot;</span>)
+<span class="k">end</span>
+
+<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"># 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="k">end</span></code></pre>
+
+<p>See the <a href="https://pablotron.github.com/zip-crystal/" target="_blank">API documentation</a>
+for additional information.</p>
+
+<h2>Development</h2>
+
+<p>TODO: Write development instructions here</p>
+
+<h2>Contributing</h2>
+
+<ol><li>Fork it ( https://github.com/pablotron/zip-crystal/fork )</li><li>Create your feature branch (git checkout -b my-new-feature)</li><li>Commit your changes (git commit -am 'Add some feature')</li><li>Push to the branch (git push origin my-new-feature)</li><li>Create a new Pull Request</li></ol>
+
+<h2>Contributors</h2>
+
+<ul><li><a href="https://github.com/pablotron" target="_blank">pablotron</a> Paul Duncan - creator, maintainer</li></ul>
+</div>
+</body>
+</html>