Class: Shella::Runner
- Inherits:
-
Object
- Object
- Shella::Runner
- Defined in:
- lib/shella/runner.rb
Instance Method Summary collapse
-
#initialize(lines) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
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
#run ⇒ Object
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 |