Class: String

Inherits:
Object
  • Object
show all
Defined in:
extconf.rb

Overview

BEGIN BACKPORTED FROM 2.0

Instance Method Summary collapse

Instance Method Details

#funcall_styleObject



55
56
57
# File 'extconf.rb', line 55

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

#quoteObject

Wraps a string in escaped quotes if it contains whitespace.



46
47
48
# File 'extconf.rb', line 46

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

#sans_argumentsObject



59
60
61
# File 'extconf.rb', line 59

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

#tr_cppObject

Generates a string used as cpp macro name.



51
52
53
# File 'extconf.rb', line 51

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