Sha256: 8389b6bb60f067d1f0be9ae572e65a2c6df4cde65f6667401c18b4eee95ee423

Contents?: true

Size: 864 Bytes

Versions: 25

Compression:

Stored size: 864 Bytes

Contents

# frozen_string_literal: true

require "uri"

if RUBY_VERSION < "2.6.0"
  require "active_support/core_ext/module/redefine_method"
  URI::Parser.class_eval do
    silence_redefinition_of_method :unescape
    def unescape(str, escaped = /%[a-fA-F\d]{2}/)
      # TODO: Are we actually sure that ASCII == UTF-8?
      # YK: My initial experiments say yes, but let's be sure please
      enc = str.encoding
      enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
      str.dup.force_encoding(Encoding::ASCII_8BIT).gsub(escaped) { |match| [match[1, 2].hex].pack("C") }.force_encoding(enc)
    end
  end
end

module URI
  class << self
    def parser
      ActiveSupport::Deprecation.warn(<<-MSG.squish)
        URI.parser is deprecated and will be removed in Rails 6.2.
        Use `URI::DEFAULT_PARSER` instead.
      MSG
      URI::DEFAULT_PARSER
    end
  end
end

Version data entries

25 entries across 25 versions & 6 rubygems

Version Path
activesupport-6.1.4.7 lib/active_support/core_ext/uri.rb
activesupport-6.1.4.6 lib/active_support/core_ext/uri.rb
activesupport-6.1.4.5 lib/active_support/core_ext/uri.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.4/lib/active_support/core_ext/uri.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.4/lib/active_support/core_ext/uri.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/activesupport-6.1.4.4/lib/active_support/core_ext/uri.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.4.4/lib/active_support/core_ext/uri.rb
activesupport-6.1.4.4 lib/active_support/core_ext/uri.rb
activesupport-6.1.4.3 lib/active_support/core_ext/uri.rb
activesupport-6.1.4.2 lib/active_support/core_ext/uri.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/core_ext/uri.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.4.1/lib/active_support/core_ext/uri.rb
activesupport-6.1.4.1 lib/active_support/core_ext/uri.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4/lib/active_support/core_ext/uri.rb
activesupport-6.1.4 lib/active_support/core_ext/uri.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.1/lib/active_support/core_ext/uri.rb
activesupport-6.1.3.2 lib/active_support/core_ext/uri.rb
activesupport-6.1.3.1 lib/active_support/core_ext/uri.rb
activesupport-6.1.3 lib/active_support/core_ext/uri.rb
activesupport-6.1.2.1 lib/active_support/core_ext/uri.rb