lib/fig/tokenized_string/plain_segment.rb
# Should not be invoked if original string was not single quoted.
Should not be invoked if original string was not single quoted.
Should not be invoked if original string was not single quoted .
def to_double_quotable_string(metacharacters)
    quoted_value = @raw_value.gsub %r< ( ["#{metacharacters}] ) >xm, '\\\\\1'
    quoted_value.gsub!(
      %r<
        (
          (?: ^ | [^\\] ) # New line or non-backslash
          (\\{2})*        # Even number of backslashes
        )
        # All single quotes must have been escaped.  The important bit is to
        # not lose escaped backslashes.
        \\'
      >xm,
      %q<\1'>
    )
    return quoted_value
  end
def to_double_quotable_string ( metacharacters ) quoted_value = @raw_value . gsub %r<  ( [" #{ metacharacters } ] )  >xm , '\\\\\1' quoted_value . gsub! ( %r< 
        (
          (?: ^ | [^ \\ ] ) # New line or non-backslash
          ( \\ {2})*        # Even number of backslashes
        )

        # All single quotes must have been escaped.  The important bit is to
        # not lose escaped backslashes.
         \\ '
       >xm , %q<\1'> ) return quoted_value end
Should not be invoked if original string was not single quoted.
Should not be invoked if original string was not single quoted .
metacharacters