bundler/lib/bundler/compact_index_client/updater.rb in rubygems-update-3.0.9 vs bundler/lib/bundler/compact_index_client/updater.rb in rubygems-update-3.1.0.pre1

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -require "bundler/vendored_fileutils" +require_relative "../vendored_fileutils" require "stringio" require "zlib" module Bundler class CompactIndexClient @@ -93,14 +93,10 @@ sum = checksum_for_file(path) sum ? %("#{sum}") : nil end def slice_body(body, range) - if body.respond_to?(:byteslice) - body.byteslice(range) - else # pre-1.9.3 - body.unpack("@#{range.first}a#{range.end + 1}").first - end + body.byteslice(range) end def checksum_for_file(path) return nil unless path.file? # This must use IO.read instead of Digest.file().hexdigest