Sha256: 1fd04c6c3ad17632f1fa68dfdb48b7eeab7207bc4fa378751227b0aaf920b3bb

Contents?: true

Size: 919 Bytes

Versions: 82

Compression:

Stored size: 919 Bytes

Contents

#!/usr/bin/env ruby

$: << "../lib"

require 'zip/zipfilesystem'

EXAMPLE_ZIP = "filesystem.zip"

File.delete(EXAMPLE_ZIP) if File.exists?(EXAMPLE_ZIP)

Zip::File.open(EXAMPLE_ZIP, Zip::File::CREATE) {
  |zf|
  zf.file.open("file1.txt", "w") { |os| os.write "first file1.txt" }
  zf.dir.mkdir("dir1")
  zf.dir.chdir("dir1")
  zf.file.open("file1.txt", "w") { |os| os.write "second file1.txt" }
  puts zf.file.read("file1.txt")
  puts zf.file.read("../file1.txt")
  zf.dir.chdir("..")
  zf.file.open("file2.txt", "w") { |os| os.write "first file2.txt" }
  puts "Entries:                   #{zf.entries.join(', ')}"
}

Zip::File.open(EXAMPLE_ZIP) {
  |zf|
  puts "Entries from reloaded zip: #{zf.entries.join(', ')}"
}

# For other examples, look at zip.rb and ziptest.rb

# Copyright (C) 2003 Thomas Sondergaard
# rubyzip is free software; you can redistribute it and/or
# modify it under the terms of the ruby license.

Version data entries

82 entries across 79 versions & 21 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rubyzip-1.1.7/samples/example_filesystem.rb