Module: Srx::Util

Defined in:
lib/srx/util.rb

Overview

Miscellaneous utility functions

Class Method Summary collapse

Class Method Details

.unwrap(str) ⇒ String

Remove linebreaks that wrap lines.

Parameters:

  • str (String)

Returns:

  • (String)


11
12
13
# File 'lib/srx/util.rb', line 11

def unwrap(str)
  str.gsub(/(?<=\S)\n(?=\S)/, ' ')
end