lib/unicode/confusable/index.rb in unicode-confusable-1.3.2 vs lib/unicode/confusable/index.rb in unicode-confusable-1.4.0

- old
+ new

@@ -1,8 +1,14 @@ -require 'rubygems/util' -require_relative 'constants' +# frozen_string_literal: true +require "zlib" +require_relative "constants" + module Unicode module Confusable - INDEX = Marshal.load(Gem::Util.gunzip(File.binread(INDEX_FILENAME))) + File.open(INDEX_FILENAME, "rb") do |file| + serialized_data = Zlib::GzipReader.new(file).read + serialized_data.force_encoding Encoding::BINARY + INDEX = Marshal.load(serialized_data) + end end end