Sha256: 00f1ccc2ec8cf231f721e7ced254474b25cdcca73175a3d6684215105dadc2c5

Contents?: true

Size: 273 Bytes

Versions: 7

Compression:

Stored size: 273 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

7 entries across 7 versions & 2 rubygems

Version Path
facets-2.4.0 lib/facets/kernel/resc.rb
facets-2.4.1 lib/facets/kernel/resc.rb
facets-2.4.2 lib/core/facets/kernel/resc.rb
facets-2.4.3 lib/core/facets/kernel/resc.rb
facets-2.4.4 lib/core/facets/kernel/resc.rb
facets-2.4.5 lib/core/facets/kernel/resc.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/kernel/resc.rb