Class: TaaS::CommandExecuter

Inherits:
Object
  • Object
show all
Defined in:
lib/helper/command_executer.rb

Class Method Summary collapse

Class Method Details

.execute_command(dir, command) ⇒ Object



3
4
5
6
7
# File 'lib/helper/command_executer.rb', line 3

def self.execute_command(dir, command)
  return nil if command.nil? || dir.nil? || command.empty? || dir.empty?
  Dir.chdir(dir)
  `#{command}`
end