Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/mkmf.rb
Overview
:stopdoc:
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.
-
#unspace ⇒ Object
Escape whitespaces for Makefile.
Instance Method Details
#funcall_style ⇒ Object
27 28 29 |
# File 'lib/mkmf.rb', line 27 def funcall_style /\)\z/ =~ self ? dup : "#{self}()" end |
#quote ⇒ Object
Wraps a string in escaped quotes if it contains whitespace.
13 14 15 |
# File 'lib/mkmf.rb', line 13 def quote /\s/ =~ self ? "\"#{self}\"" : "#{self}" end |
#sans_arguments ⇒ Object
31 32 33 |
# File 'lib/mkmf.rb', line 31 def sans_arguments self[/\A[^()]+/] end |
#tr_cpp ⇒ Object
Generates a string used as cpp macro name.
23 24 25 |
# File 'lib/mkmf.rb', line 23 def tr_cpp strip.upcase.tr_s("^A-Z0-9_*", "_").tr_s("*", "P") end |
#unspace ⇒ Object
Escape whitespaces for Makefile.
18 19 20 |
# File 'lib/mkmf.rb', line 18 def unspace gsub(/\s/, '\\\\\\&') end |