123456789_123456789_123456789_123456789_123456789_

Class: String

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: lib/mkmf.rb

Instance Method Summary

Instance Method Details

#funcall_style

[ GitHub ]

  
# File 'lib/mkmf.rb', line 28

def funcall_style
  /\)\z/ =~ self ? dup : "#{self}()"
end

#quote

Wraps a string in escaped quotes if it contains whitespace.

[ GitHub ]

  
# File 'lib/mkmf.rb', line 14

def quote
  /\s/ =~ self ? "\"#{self}\"" : "#{self}"
end

#sans_arguments

[ GitHub ]

  
# File 'lib/mkmf.rb', line 32

def sans_arguments
  self[/\A[^()]+/]
end

#tr_cpp

Generates a string used as cpp macro name.

[ GitHub ]

  
# File 'lib/mkmf.rb', line 24

def tr_cpp
  strip.upcase.tr_s("^A-Z0-9_*", "_").tr_s("*", "P")
end

#unspace

Escape whitespaces for Makefile.

[ GitHub ]

  
# File 'lib/mkmf.rb', line 19

def unspace
  gsub(/\s/, '\\\\\\&')
end