rack.git  about / heads / tags
a modular Ruby webserver interface
blob a32fcdf629a3fff24c5d680ed26ae23ac2ae29d2 307 bytes (raw)
$ git show no-unicorn:lib/rack/core_ext/regexp.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 
# 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

git clone https://yhbt.net/rack.git