aboutsummaryrefslogtreecommitdiff
path: root/Zip/Writer.html
diff options
context:
space:
mode:
Diffstat (limited to 'Zip/Writer.html')
-rw-r--r--Zip/Writer.html49
1 files changed, 24 insertions, 25 deletions
diff --git a/Zip/Writer.html b/Zip/Writer.html
index c28c13e..894055d 100644
--- a/Zip/Writer.html
+++ b/Zip/Writer.html
@@ -255,14 +255,14 @@ return the number of bytes written.</p>
<p>Example:</p>
-<p># create IO from "/path/to/bar.txt"
-File.open("/path/to/bar.txt, "rb") do |io|
-# write to "foo.zip"
-Zip.write("foo.zip") do |zip|
-# add "bar.txt" with contents of given IO
-zip.add("bar.txt", io)
-end
-end</p></div>
+<pre><code><span class="c"># create IO from &quot;/path/to/bar.txt&quot;</span>
+<span class="t">File</span>.open(<span class="s">&quot;/path/to/bar.txt, &quot;</span>rb<span class="s">&quot;&#41; do |io|
+ # write to &quot;</span>foo.zip<span class="s">&quot;
+ Zip.write&#40;&quot;</span>foo.zip<span class="s">&quot;&#41; do |zip|
+ # add &quot;</span>bar.txt<span class="s">&quot; with contents of given IO
+ zip.add&#40;&quot;</span>bar.txt<span class="s">&quot;, io&#41;
+ end
+end</code></pre></div>
<br/>
<div>
@@ -283,11 +283,11 @@ written.</p>
<p>Example:</p>
-<p># write to "foo.zip"
-Zip.write("foo.zip") do |zip|
-# add "bar.txt" with contents "hello!"
-zip.add("bar.txt", "hello!")
-end</p></div>
+<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 &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="k">end</span></code></pre></div>
<br/>
<div>
@@ -308,11 +308,11 @@ of bytes written.</p>
<p>Example:</p>
-<p># write to "foo.zip"
-Zip.write("foo.zip") do |zip|
-# add local file "/path/to/bar.txt" as "bar.txt"
-zip.add_file("bar.txt", "/path/to/bar.txt")
-end</p></div>
+<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 local file &quot;/path/to/bar.txt&quot; as &quot;bar.txt&quot;</span>
+ zip.add_file(<span class="s">&quot;bar.txt&quot;</span>, <span class="s">&quot;/path/to/bar.txt&quot;</span>)
+<span class="k">end</span></code></pre></div>
<br/>
<div>
@@ -332,14 +332,13 @@ end</p></div>
<p>Example:</p>
-<p>Zip.write("foo.zip") do |zip|
-# add "bar.txt"
-zip.add_file("bar.txt", "/path/to/bar.txt")</p>
+<pre><code><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;</span>
+ zip.add_file(<span class="s">&quot;bar.txt&quot;</span>, <span class="s">&quot;/path/to/bar.txt&quot;</span>)
-<pre><code><span class="c"># print number of bytes written so far</span>
-puts <span class="s">&quot;bytes written so far: </span><span class="i">#{</span></span>zip.bytes_written<span class="s"><span class="i">}</span>&quot;</span></code></pre>
-
-<p>end</p></div>
+ <span class="c"># print number of bytes written so far</span>
+ puts <span class="s">&quot;bytes written so far: </span><span class="i">#{</span></span>zip.bytes_written<span class="s"><span class="i">}</span>&quot;</span>
+<span class="k">end</span></code></pre></div>
<br/>
<div>