Module: Space2underscore

Defined in:
lib/space2underscore.rb,
lib/space2underscore/version.rb

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.convert_to_underscore(argv) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/space2underscore.rb', line 4

def self.convert_to_underscore(argv)
  if argv
    space_include = argv.gsub(/\s/, '_')
    copy_command = `echo #{space_include} | ruby -pe 'chomp' | pbcopy`
    return space_include, copy_command
  else
    raise "Error! Please enter string"
  end
end