Class: Regexp

Inherits:
Object
  • Object
show all
Defined in:
lib/ver/plist.rb

Overview

Define some magic constants that aren’t available but may be returned from Regexp#options so we can make sure that roundtrip via PP works.

1.9.2 actually defines Regexp::FIXEDENCODING, but there’s no release yet, so we simply assume the values from the Ruby C source (which means this might not work on any other implementation). Hopefully nobody tries to convert textmate bundles unless they are on MRI 1.9.1 ;)

Constant Summary collapse

NO_ENCODING =
//n.options

Instance Method Summary collapse

Instance Method Details

#inspectObject

Take into account //n option



20
21
22
23
24
25
26
# File 'lib/ver/plist.rb', line 20

def inspect
  if options & NO_ENCODING == 0
    original_inspect
  else
    original_inspect << 'n'
  end
end

#original_inspectObject



17
# File 'lib/ver/plist.rb', line 17

alias original_inspect inspect