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.
182 183 184 |
# File 'lib/mkmfmf.rb', line 182 def quote /\s/ =~ self ? "\"#{self}\"" : "#{self}" end |
#tr_cpp ⇒ Object
Generates a string used as cpp macro name.
187 188 189 |
# File 'lib/mkmfmf.rb', line 187 def tr_cpp strip.upcase.tr_s("^A-Z0-9_", "_") end |