Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/linguist_ruby/helpers.rb

Instance Method Summary collapse

Instance Method Details

#shellescapeObject



117
118
119
# File 'lib/linguist_ruby/helpers.rb', line 117

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