Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/mkmf.rb

Instance Method Summary collapse

Instance Method Details

#quoteObject

Wraps a string in escaped quotes if it contains whitespace.



151
152
153
# File 'lib/mkmf.rb', line 151

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

#tr_cppObject

Generates a string used as cpp macro name.



156
157
158
# File 'lib/mkmf.rb', line 156

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