From 69ba05dd7237be806f4d29242a7b8f499ef9accf Mon Sep 17 00:00:00 2001 From: kellydunn Date: Mon, 12 Mar 2012 16:31:55 -0700 Subject: [PATCH] [README] Updating README --- README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e264cd..4c12c7d 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,24 @@ To run the unit tests you need to have test::unit installed rake test [![Build Status](https://secure.travis-ci.org/aussiegeek/rubyzip.png)](http://travis-ci.org/aussiegeek/rubyzip) +Configuration +------------- + +By default, rubyzip will not overwrite files if they already exist inside of the extracted path. To change this behavior, you may specify a configuration option like so: + +``` +Zip.options[:on_exists_proc] = true +``` + +If you're using rubyzip with rails, consider placing this snippet of code in an initializer file such as `config/initializers/rubyzip.rb` + +Additionally, if you want to configure rubyzip to overwrite pre-existing files while creating a .zip file, you can do so with the following: + +``` +Zip.options[:continue_on_exists_proc] = true +``` + + Documentation ------------- @@ -68,4 +86,4 @@ Thomas Sondergaard (thomas at sondergaard.cc) Technorama Ltd. (oss-ruby-zip at technorama.net) -extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org) \ No newline at end of file +extra-field support contributed by Tatsuki Sugiura (sugi at nemui.org)