From 055abed0e28681387377671bc16d40d075e3aaf7 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 10 Aug 2016 21:16:44 -0400 Subject: update documentation --- Zip/Entry.html | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'Zip/Entry.html') diff --git a/Zip/Entry.html b/Zip/Entry.html index 6626777..9e31614 100644 --- a/Zip/Entry.html +++ b/Zip/Entry.html @@ -121,18 +121,17 @@ specific archive entry.

Example:

-

# create MemoryIO -io = MemoryIO.new

+
# create MemoryIO
+io = MemoryIO.new
 
-

# open "foo.zip" -Zip.read("foo.zip") do |zip| -# get "bar.txt" entry from "foo.zip" -e = zip["bar.txt"]

+# open "foo.zip" +Zip.read("foo.zip") do |zip| + # get "bar.txt" entry from "foo.zip" + e = zip["bar.txt"] -
# read contents of "bar.txt" into io
-e.read(io)
- -

end

+ # read contents of "bar.txt" into io + e.read(io) +end
@@ -463,11 +462,11 @@ file's entry in the Central Directory, and this method returns the

Example:

-

# open "./foo.zip" -Zip.read("./foo.zip") do |zip| -# get array of local extra attributes from "bar.txt" -extras = zip["bar.txt"].local_extras -end

+
# open "./foo.zip"
+Zip.read("./foo.zip") do |zip|
+  # get array of local extra attributes from "bar.txt"
+  extras = zip["bar.txt"].local_extras
+end

@@ -532,14 +531,14 @@ compression method is unsupported.

Example:

-

# open "output-bar.txt" for writing -File.open("output-bar.txt", "wb") do |io| -# open archive "./foo.zip" -Zip.read("foo.zip") do |zip| -# write contents of "bar.txt" to "output-bar.txt" -zip["foo.txt"].read(io) -end -end

+
# open "output-bar.txt" for writing
+File.open("output-bar.txt", "wb") do |io|
+  # open archive "./foo.zip"
+  Zip.read("foo.zip") do |zip|
+    # write contents of "bar.txt" to "output-bar.txt"
+    zip["foo.txt"].read(io)
+  end
+end

@@ -559,10 +558,10 @@ end

Example:

-

Zip.read("foo.zip") do |zip| -size = zip["bar.txt"].size -puts "bar.txt is #{size} bytes." -end

+
Zip.read("foo.zip") do |zip|
+  size = zip["bar.txt"].size
+  puts "bar.txt is #{size} bytes."
+end

-- cgit v1.2.3