Sha256: ad03e37c9452488f9ffd8dff8d629855858d53e32d823ec2d913e5b29e43e74f

Contents?: true

Size: 271 Bytes

Versions: 10

Compression:

Stored size: 271 Bytes

Contents

module Kernel

  # Provides a shortcut to the Regexp.escape module method.
  #
  #   resc("H..LO")   #=> "H\\.\\.LO"
  #
  #   TODO: Should this be deprecated in favor of String#to_re/to_rx ?
  #
  # CREDIT: Trans

  def resc(str)
    Regexp.escape(str.to_s)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/resc.rb
facets-2.8.3 lib/core/facets/kernel/resc.rb
facets-2.8.2 lib/core/facets/kernel/resc.rb
facets-2.8.1 lib/core/facets/kernel/resc.rb
facets-2.8.0 lib/core/facets/kernel/resc.rb
facets-2.7.0 lib/core/facets/kernel/resc.rb
facets-2.6.0 lib/core/facets/kernel/resc.rb
facets-2.5.1 lib/core/facets/kernel/resc.rb
facets-2.5.0 lib/core/facets/kernel/resc.rb
facets-2.5.2 lib/core/facets/kernel/resc.rb