Class: LSL::Shell
Instance Attribute Summary collapse
-
#last_execution ⇒ Object
Returns the value of attribute last_execution.
Instance Method Summary collapse
Instance Attribute Details
#last_execution ⇒ Object
Returns the value of attribute last_execution.
118 119 120 |
# File 'lib/lsl/shell.rb', line 118 def last_execution @last_execution end |
Instance Method Details
#get_input ⇒ Object
124 125 126 127 128 |
# File 'lib/lsl/shell.rb', line 124 def get_input #STDIN.gets.strip require 'readline' Readline.readline("#{Dir.getwd}> ",true).strip end |
#run(str) ⇒ Object
121 122 123 |
# File 'lib/lsl/shell.rb', line 121 def run(str) self.last_execution = LSL::CommandExecution::Compound.new(:command_str => str, :shell => self).tap { |x| x.run! } end |
#run_loop ⇒ Object
129 130 131 132 133 134 135 |
# File 'lib/lsl/shell.rb', line 129 def run_loop loop do str = get_input run(str) last_execution.print! end end |