Skip to content

Adjustments for RubyZip 3.0 #50

@nodeg

Description

@nodeg

RubyZip is giving the following warning:

root@head-min-centos7 ~]# gem install tetra
Fetching: clamp-1.3.2.gem (100%)
Successfully installed clamp-1.3.2
Fetching: json_pure-2.6.2.gem (100%)
Successfully installed json_pure-2.6.2
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: rubyzip-2.3.2.gem (100%)
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.
Successfully installed rubyzip-2.3.2
Fetching: text-1.3.1.gem (100%)
Successfully installed text-1.3.1
Fetching: tetra-2.0.6.gem (100%)
Successfully installed tetra-2.0.6
6 gems installed

RubyZip is only used in pom_getter.rb:

    # returns a pom embedded in a jar file
    def get_pom_from_jar(file)
      log.debug("Attempting unpack of #{file} to find a POM")
      begin
        Zip::File.foreach(file) do |entry|
          if entry.name =~ %r{/pom.xml$}
            log.info("pom.xml found in #{file}##{entry.name}")
            return entry.get_input_stream.read, :found_in_jar
          end
        end
      rescue Zip::Error
        log.warn("#{file} does not seem to be a valid jar archive, skipping")
      rescue TypeError
        log.warn("#{file} seems to be a valid jar archive but is corrupt, skipping")
      end
      nil
    end

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions