Class: Shella::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/shella/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ Runner

Returns a new instance of Runner.



3
4
5
# File 'lib/shella/runner.rb', line 3

def initialize(lines)
  @lines = lines.map { |line| line.strip }
end

Instance Method Details

#runObject



7
8
9
10
11
12
13
# File 'lib/shella/runner.rb', line 7

def run
  @lines.each do |line|
    next if line.size.zero?
    command, args = line.split(" ", 2)
    Shella::Shell.send(command, args)
  end
end