Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/transcriptic/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#prepend_each(separator, value) ⇒ Object



2
3
4
# File 'lib/transcriptic/core_ext/string.rb', line 2

def prepend_each(separator, value)
  lines(separator).collect { |x| value + x }.join
end

#shellescapeObject



5
6
7
# File 'lib/transcriptic/core_ext/string.rb', line 5

def shellescape
  empty? ? "''" : gsub(/([^A-Za-z0-9_\-.,:\/@\n])/n, '\\\\\\1').gsub(/\n/, "'\n'")
end