Class: Controller

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

Instance Method Summary collapse

Constructor Details

#initializeController

Returns a new instance of Controller.



5
6
7
8
9
# File 'lib/controller.rb', line 5

def initialize
  connect
  trap_int
  @lines = []
end

Instance Method Details

#runObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/controller.rb', line 11

def run
  if ENV["EMACS"] == "t"
    emacs_run_loop
  elsif @options.input_file
    show File.read(@options.input_file)
  elsif @options.query
    show @options.query
  else
    run_loop
  end
end