Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- extconf.rb
Overview
BEGIN BACKPORTED FROM 2.0
Instance Method Summary collapse
- #funcall_style ⇒ Object
-
#quote ⇒ Object
Wraps a string in escaped quotes if it contains whitespace.
- #sans_arguments ⇒ Object
-
#tr_cpp ⇒ Object
Generates a string used as cpp macro name.
Instance Method Details
#funcall_style ⇒ Object
55 56 57 |
# File 'extconf.rb', line 55 def funcall_style /\)\z/ =~ self ? dup : "#{self}()" end |
#quote ⇒ Object
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_arguments ⇒ Object
59 60 61 |
# File 'extconf.rb', line 59 def sans_arguments self[/\A[^()]+/] end |
#tr_cpp ⇒ Object
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 |