Skip to content

Commit

Permalink
Print banner text re v3.0.0 when zip is required.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Jul 3, 2021
1 parent 84d7a66 commit 16de339
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/zip.rb
Expand Up @@ -34,6 +34,25 @@
require 'zip/errors'

module Zip
BANNER = [
'RubyZip 3.0 is coming!',
'**********************',
'',
'The public API of some Rubyzip classes has been modernized to use named',
'parameters for optional arguments. Please check your usage of the',
'following classes:',
' * `Zip::File`',
' * `Zip::Entry`',
' * `Zip::InputStream`',
' * `Zip::OutputStream`',
'',
'Please ensure that your Gemfiles and .gemspecs are suitably restrictive',
'to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).',
'See https://github.com/rubyzip/rubyzip for details. The Changelog also',
'lists other enhancements and bugfixes that have been implemented since',
'version 2.3.0.'
].freeze

extend self
attr_accessor :unicode_names,
:on_exists_proc,
Expand All @@ -47,6 +66,8 @@ module Zip
:validate_entry_sizes

def reset!
warn BANNER.join("\n") unless BANNER.empty?

@_ran_once = false
@unicode_names = false
@on_exists_proc = false
Expand Down

0 comments on commit 16de339

Please sign in to comment.