test/test_helper.rb
# Parse the format used in RFC 6376
#
# In the following examples, actual whitespace is used only for
# clarity.  The actual input and output text is designated using
# bracketed descriptors: "<SP>" for a space character, "<HTAB>" for a
# tab character, and "<CRLF>" for a carriage-return/line-feed sequence.
# For example, "X <SP> Y" and "X<SP>Y" represent the same three
# characters.
Parse the format used in RFC 6376
In the following examples, actual whitespace is used only for
clarity.
Parse the format used in RFC 6376 In the following examples actual whitespace is used only for clarity .
def rfc_format
    str = self.dup
    str.gsub!(/\s/,'')
    str.gsub!(/<SP>/i,' ')
    str.gsub!(/<CR>/i,"\r")
    str.gsub!(/<LF>/i,"\n")
    str.gsub!(/<CRLF>/i,"\r\n")
    str.gsub!(/<HTAB>/i,"\t")
    str
  end
def rfc_format str = self . dup str . gsub! ( / \s / , '' ) str . gsub! ( / <SP> /i , ' ' ) str . gsub! ( / <CR> /i , "\r" ) str . gsub! ( / <LF> /i , "\n" ) str . gsub! ( / <CRLF> /i , "\r\n" ) str . gsub! ( / <HTAB> /i , "\t" ) str end
Parse the format used in RFC 6376
In the following examples, actual whitespace is used only for
clarity.
Parse the format used in RFC 6376 In the following examples actual whitespace is used only for clarity .