class String

Public Instance Methods

double_quote() click to toggle source
# File lib/deployable/patch/string/quoting.rb, line 20
def double_quote
  quote '"'
end
needs_quoting?(check = /\s/) click to toggle source
# File lib/deployable/patch/string/quoting.rb, line 24
def needs_quoting? check = /\s/
  !!match(check)
end
quote(char) click to toggle source
# File lib/deployable/patch/string/quoting.rb, line 3
def quote char
  # improve this to escape chars, if they aren't already escaped
  raise if match char
  "#{char}#{self}#{char}"
end
quote_escape(char) click to toggle source
# File lib/deployable/patch/string/quoting.rb, line 9
def quote_escape char
  #if m = match char
  #  m.
  #end
  "#{char}#{self}#{char}"
end
single_quote() click to toggle source
# File lib/deployable/patch/string/quoting.rb, line 16
def single_quote
  quote "'"
end