module ZipContainer::Util
Utility methods useful throughout the rest of the ZipContainer
library.
Public Instance Methods
Source
# File lib/zip-container/util.rb, line 53 def entry_name(entry) name = entry.is_a?(::Zip::Entry) ? entry.name : entry name.respond_to?(:chomp) ? name.chomp('/') : name end
A lot of methods can take either a String or a Zip::Entry object to represent an item in a Zip file so this method normalizes these parameters.
In common with rubyzip this method also removes a trailing slash (/) from a name if it can.