Sha256: b3b0d47105b7448684539241372fbc6403c4326d1f6712f2f7e3e5fbe314bb8e

Contents?: true

Size: 307 Bytes

Versions: 73

Compression:

Stored size: 307 Bytes

Contents

# frozen_string_literal: true

# Regexp has `match?` since Ruby 2.4
# so to support Ruby < 2.4 we need to define this method

module Rack
  module RegexpExtensions
    refine Regexp do
      def match?(string, pos = 0)
        !!match(string, pos)
      end
    end unless //.respond_to?(:match?)
  end
end

Version data entries

73 entries across 57 versions & 15 rubygems

Version Path
rack-2.2.3 lib/rack/core_ext/regexp.rb
rack-2.1.4 lib/rack/core_ext/regexp.rb
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/core_ext/regexp.rb
rack-2.1.3 lib/rack/core_ext/regexp.rb
argon-1.3.1 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/core_ext/regexp.rb
symbolic_enum-1.1.5 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/core_ext/regexp.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/rack-2.2.2/lib/rack/core_ext/regexp.rb
rack-2.2.2 lib/rack/core_ext/regexp.rb
rack-2.2.1 lib/rack/core_ext/regexp.rb
rack-2.2.0 lib/rack/core_ext/regexp.rb
rack-2.1.2 lib/rack/core_ext/regexp.rb
rack-2.1.1 lib/rack/core_ext/regexp.rb
rack-2.1.0 lib/rack/core_ext/regexp.rb