Skip to content

Commit

Permalink
Move to using a post install message for 3.0 warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Jul 5, 2021
1 parent 16de339 commit 2f1c1ea
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
@@ -1,5 +1,9 @@
# X.X.X (Next)

# 2.3.2 (2021-07-05)

- This is a dummy release to warn about breaking changes coming in version 3.0. This updated version uses the Gem `post_install_message` instead of printing to `STDERR`.

# 2.3.1 (2021-07-03)

- This is a dummy release to warn about breaking changes coming in version 3.0.
Expand Down
21 changes: 0 additions & 21 deletions lib/zip.rb
Expand Up @@ -34,25 +34,6 @@
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 @@ -66,8 +47,6 @@ 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
2 changes: 1 addition & 1 deletion lib/zip/version.rb
@@ -1,3 +1,3 @@
module Zip
VERSION = '2.3.1'
VERSION = '2.3.2'
end
18 changes: 18 additions & 0 deletions rubyzip.gemspec
Expand Up @@ -26,4 +26,22 @@ Gem::Specification.new do |s|
s.add_development_dependency 'pry', '~> 0.10'
s.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
s.add_development_dependency 'rubocop', '~> 0.79'
s.post_install_message = <<~ENDBANNER
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.
ENDBANNER
end

0 comments on commit 2f1c1ea

Please sign in to comment.