Code Coverage
 
Lines
Covered
80.95% covered (warning)
80.95%
17 / 21
1
require 'logger'
1
module TheFox
1
module TermKit
1
class App
1
attr_accessor :logger
1
def initialize
16
@exit = false
16
@logger = Logger.new('termkit_app.log')
16
@logger.level = Logger::DEBUG
end
##
# Calls `run_cycle()` in a loop.
1
def run
#puts 'App run'
0
loop_cycle = 0
0
while !@exit
0
loop_cycle += 1
0
run_cycle
#sleep @run_cycle_sleep
end
end
##
# As single cycle of `run()`.
1
def run_cycle
#puts 'App run_cycle'
end
##
# Call this to terminate the App.
1
def terminate
3
if !@exit
# puts 'App->terminate'
2
@exit = true
2
app_will_terminate
end
end
1
protected
##
# This can be implemented by a sub-class of App.
1
def app_will_terminate
# puts 'App->app_will_terminate'
end
end
end
end