• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ruby-106/ruby/lib/webrick/

Lines Matching refs:str

170     # Splits a header value +str+ according to HTTP specification.
172 def split_header_value(str)
173 str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+)
218 # Removes quotes and escapes from +str+
220 def dequote(str)
221 ret = (/\A"(.*)"\Z/ =~ str) ? $1 : str.dup
228 # Quotes and escapes quotes in +str+
230 def quote(str)
231 '"' << str.gsub(/[\\\"]/o, "\\\1") << '"'
292 # Adds +str+ to this FormData which may be the body, a header or a
297 def <<(str)
300 elsif str == CRLF
307 @raw_header << str
366 # Parses the query component of a URI in +str+
368 def parse_query(str)
370 if str
371 str.split(/[&;]/).each{|x|
438 def _make_regex(str) /([#{Regexp.escape(str)}])/n end
439 def _make_regex!(str) /([^#{Regexp.escape(str)}])/n end
440 def _escape(str, regex)
441 str = str.b
442 str.gsub!(regex) {"%%%02X" % $1.ord}
444 str.force_encoding(Encoding::US_ASCII)
446 def _unescape(str, regex)
447 str = str.b
448 str.gsub!(regex) {$1.hex.chr}
450 str
462 # Escapes HTTP reserved and unwise characters in +str+
464 def escape(str)
465 _escape(str, UNESCAPED)
469 # Unescapes HTTP reserved and unwise characters in +str+
471 def unescape(str)
472 _unescape(str, ESCAPED)
476 # Escapes form reserved characters in +str+
478 def escape_form(str)
479 ret = _escape(str, UNESCAPED_FORM)
485 # Unescapes form reserved characters in +str+
487 def unescape_form(str)
488 _unescape(str.gsub(/\+/, " "), ESCAPED)
492 # Escapes path +str+
494 def escape_path(str)
496 str.scan(%r{/([^/]*)}).each{|i|
503 # Escapes 8 bit characters in +str+
505 def escape8bit(str)
506 _escape(str, NONASCII)