Module: Sform
- Defined in:
- lib/extensions/utils/scanner.rb
Class Method Summary collapse
Class Method Details
.titleify(title) ⇒ Object
17 18 19 20 21 |
# File 'lib/extensions/utils/scanner.rb', line 17 def self.titleify(title) title = title.tr('_', ' ') title = title.lstrip title = title.split.map(&:capitalize).join(' ') end |
.trim(string) ⇒ Object
4 5 6 7 |
# File 'lib/extensions/utils/scanner.rb', line 4 def self.trim(string) string = string.gsub(/^#{$srcdir}\//, '') unless string.nil? string = string.gsub(/(\.adoc)/, '') unless string.nil? end |
.underscorify(title) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/extensions/utils/scanner.rb', line 9 def self.underscorify(title) title = title.downcase.gsub(/(\s|-)/, '_') # document attribute idprefix must be seet to empty, if not # the default value is an underscore and the following line is required # t = t.prepend('_') unless t.match(/^_/) title = title.gsub(/___/, '_').delete('`') end |