Class: String

Inherits:
Object show all
Defined in:
lib/mkmfmf.rb

Instance Method Summary collapse

Instance Method Details

#quoteObject

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_cppObject

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