Code Review: Regex6

tfpt review “/shelveset:Regex6;REDMOND\tomat”

Regexp fixes:

  •   Implements Regexp.initialize
    
  •   Fixes Regexp.new and compile signatures.
    
  •   Regexp.new does no escaping, it just takes whatever string is 
    

given and makes up Regexp

  •   Regexp.to_s returns 
    

“(?{enabled-options}-{disabled-options}:{pattern-with-forward-slash-escaped})”

  •   Regexp.inspect returs "/{pattern-with-forward-slash-escaped}/"
    
  •   Regexp.union does Regexp.escape (w/o calling it) on given 
    

strings (and objects converted using to_str ) and does Regexp.to_s
(w/o calling it) on given regexes, concatenates all results using | as
separator and calls Regexp.new(, nil, nil) on the result.

Fixes escaping of strings (String#inspect).
Fixes chr, IO.write to honor current encoding.
Makes ConsoleStreams host-redirectable.

Tomas