Class: Crabfarm::Modes::Console
- Inherits:
-
Object
- Object
- Crabfarm::Modes::Console
- Defined in:
- lib/crabfarm/modes/console.rb
Defined Under Namespace
Classes: ConsoleDsl
Class Method Summary collapse
Class Method Details
.start(_context) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/crabfarm/modes/console.rb', line 59 def self.start(_context) dsl = ConsoleDsl.new _context loop do begin dsl.instance_eval Readline.readline("> ", true) rescue SyntaxError => se puts "Syntax error: #{se.}".color(:red) rescue SystemExit, Interrupt break rescue => e puts "Unknown command".color(:red) end end puts "Releasing crawling context".color(:green) _context.release end |