Class: String

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

Overview

:stopdoc:

Instance Method Summary collapse

Instance Method Details

#funcall_styleObject



26
27
28
# File 'lib/mkmf.rb', line 26

def funcall_style
  /\)\z/ =~ self ? dup : "#{self}()"
end

#quoteObject

Wraps a string in escaped quotes if it contains whitespace.



12
13
14
# File 'lib/mkmf.rb', line 12

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

#sans_argumentsObject



30
31
32
# File 'lib/mkmf.rb', line 30

def sans_arguments
  self[/\A[^()]+/]
end

#tr_cppObject

Generates a string used as cpp macro name.



22
23
24
# File 'lib/mkmf.rb', line 22

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

#unspaceObject

Escape whitespaces for Makefile.



17
18
19
# File 'lib/mkmf.rb', line 17

def unspace
  gsub(/\s/, '\\\\\\&')
end