Class: String
Instance Method Summary collapse
-
#quote ⇒ Object
Wraps a string in escaped quotes if it contains whitespace.
-
#tr_cpp ⇒ Object
Generates a string used as cpp macro name.
Instance Method Details
#quote ⇒ Object
Wraps a string in escaped quotes if it contains whitespace.
181 182 183 |
# File 'lib/mkmf.rb', line 181 def quote /\s/ =~ self ? "\"#{self}\"" : "#{self}" end |
#tr_cpp ⇒ Object
Generates a string used as cpp macro name.
186 187 188 |
# File 'lib/mkmf.rb', line 186 def tr_cpp strip.upcase.tr_s("^A-Z0-9_*", "_").tr_s("*", "P") end |