Class: MetaCL::Utils
- Inherits:
-
Object
- Object
- MetaCL::Utils
- Defined in:
- lib/metacl/utils.rb
Class Method Summary collapse
Class Method Details
.stringify_text(text) ⇒ Object
8 9 10 11 12 |
# File 'lib/metacl/utils.rb', line 8 def stringify_text(text) text.split("\n").map{ |s| '"' + s.gsub('"', '""') + '\\n"' }.tap { |t| t[-1] = t[-1] + ";" }.join("\n") end |
.tab_text(text, tabs = 1, tab_size = 4) ⇒ Object
4 5 6 |
# File 'lib/metacl/utils.rb', line 4 def tab_text(text, tabs = 1, tab_size = 4) text.split("\n").map{ |s| ' '*tab_size*tabs + s }.join("\n") end |