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
- #funcall_style
-
#quote
Wraps a string in escaped quotes if it contains whitespace.
- #sans_arguments
-
#tr_cpp
Generates a string used as cpp macro name.
-
#unspace
Escape whitespaces for Makefile.
Instance Method Details
#funcall_style
[ GitHub ]# File 'lib/mkmf.rb', line 27
def funcall_style /\)\z/ =~ self ? dup : "#{self}()" end
#quote
Wraps a string in escaped quotes if it contains whitespace.
# File 'lib/mkmf.rb', line 13
def quote /\s/ =~ self ? "\"#{self}\"" : "#{self}" end
#sans_arguments
[ GitHub ]# File 'lib/mkmf.rb', line 31
def sans_arguments self[/\A[^()]+/] end
#tr_cpp
Generates a string used as cpp macro name.
# File 'lib/mkmf.rb', line 23
def tr_cpp strip.upcase.tr_s("^A-Z0-9_*", "_").tr_s("*", "P") end
#unspace
Escape whitespaces for Makefile.
# File 'lib/mkmf.rb', line 18
def unspace gsub(/\s/, '\\\\\\&') end