Sha256: d272864ac990783510171dbe1449f93cd0d99f485120aa1aaf56716918061074

Contents?: true

Size: 498 Bytes

Versions: 4

Compression:

Stored size: 498 Bytes

Contents

require 'socket'
require 'timeout'

require 'riddle/client'
require 'riddle/configuration'
require 'riddle/controller'

module Riddle #:nodoc:
  class ConnectionError < StandardError #:nodoc:
    #
  end
  
  def self.escape_pattern
    Thread.current[:riddle_escape_pattern] ||= /[\(\)\|\-!@~"&\/]/
  end
  
  def self.escape_pattern=(pattern)
    Thread.current[:riddle_escape_pattern] = pattern
  end
  
  def self.escape(string)
    string.gsub(escape_pattern) { |char| "\\#{char}" }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
riddle-1.0.3 lib/riddle.rb
riddle-1.0.2 lib/riddle.rb
riddle-1.0.1 lib/riddle.rb
riddle-1.0.0 lib/riddle.rb