Method: Gitlab::Help.change_help_output!
- Defined in:
- lib/gitlab/help.rb
.change_help_output!(cmd, output_str) ⇒ Object
Massage output from ‘ri’.
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/gitlab/help.rb', line 81 def change_help_output!(cmd, output_str) output_str = +output_str output_str.gsub!(/#{cmd}(\(.*?\))/m, "#{cmd}\\1") output_str.gsub!(/,\s*/, ', ') # Ensure @option descriptions are on a single line output_str.gsub!(/\n\[/, " \[") output_str.gsub!(/\s(@)/, "\n@") output_str.gsub!(/(\])\n(:)/, '\\1 \\2') output_str.gsub!(/(:.*)(\n)(.*\.)/, '\\1 \\3') output_str.gsub!(/\{(.+)\}/, '"{\\1}"') end |