Class: PolishGeeks::DevTools::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/polish_geeks/dev_tools/shell.rb

Overview

Class wrapping shell commands executing

Instance Method Summary collapse

Instance Method Details

#execute(command) ⇒ String

Executes a given command in a system shell and returns its output

Examples:

Run ‘ls’ command and assing the output

ls = PolishGeeks::DevTools::Shell.new.execute('ls')
print ls #=> 'app app.rb Capfile ...'

Parameters:

  • command (String)

    that should be executed

Returns:

  • (String)

    executed command output



11
12
13
# File 'lib/polish_geeks/dev_tools/shell.rb', line 11

def execute(command)
  `#{command}`
end