Sha256: 610cc6b8c076149c039cb3cf215d288d842ebe1af72233b15839b60ab2f8697c

Contents?: true

Size: 202 Bytes

Versions: 11

Compression:

Stored size: 202 Bytes

Contents

unless String.method_defined? :match?
  class String
    def match?(*args)
      # Fiber to avoid setting $~
      f = Fiber.new do
        !match(*args).nil?
      end
      f.resume
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
backports-3.11.3 lib/backports/2.4.0/string/match.rb
backports-3.11.2 lib/backports/2.4.0/string/match.rb
backports-3.11.1 lib/backports/2.4.0/string/match.rb
backports-3.11.0 lib/backports/2.4.0/string/match.rb
backports-3.10.3 lib/backports/2.4.0/string/match.rb
backports-3.10.2 lib/backports/2.4.0/string/match.rb
backports-3.10.1 lib/backports/2.4.0/string/match.rb
backports-3.10.0 lib/backports/2.4.0/string/match.rb
backports-3.9.1 lib/backports/2.4.0/string/match.rb
backports-3.9.0 lib/backports/2.4.0/string/match.rb
backports-3.8.0 lib/backports/2.4.0/string/match.rb