Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/workflow-to-galaxy.rb

Overview

Add methods to the String class to operate on file paths.

Instance Method Summary collapse

Instance Method Details

#to_filenameObject

:call-seq:

str.to_filename -> string

Returns a new String with spaces substituted by underscores and removes all special characters.


17
18
19
# File 'lib/workflow-to-galaxy.rb', line 17

def to_filename
  self.gsub(/ /, '_').gsub(/[^A-Za-z0-9_]/, '')
end