class AsciiParadise::ClockCounter
Constants
- RUN_ALREADY
#¶ ↑
RUN_ALREADY
¶ ↑#¶ ↑
- SLEEP_FOR_N_SECONDS
#¶ ↑
SLEEP_FOR_N_SECONDS
¶ ↑#¶ ↑
Public Class Methods
new( run_already = RUN_ALREADY ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/ascii_paradise/clock_counter/clock_counter.rb, line 29 def initialize( run_already = RUN_ALREADY ) register_sigint reset case run_already when :no_colours disable_colours run_already = RUN_ALREADY end if block_given? yielded = yield case yielded # ===================================================================== # # === :rename_kde_konsole_tab # ===================================================================== # when :rename_kde_konsole_tab do_rename_kde_konsole_tab end end run if run_already end
Public Instance Methods
consider_requiring_the_kde_konsole_tab_renamer()
click to toggle source
disable_colours()
click to toggle source
display_time()
click to toggle source
#¶ ↑
display_time
¶ ↑
#¶ ↑
# File lib/ascii_paradise/clock_counter/clock_counter.rb, line 149 def display_time use_this_time = Time.now.strftime('%H:%M:%S').strip e use_this_time # ======================================================================= # # Also check if we have to modify the KDE konsole tab. # ======================================================================= # if @rename_kde_konsole_tab Roebe.rename_kde_konsole_tab(use_this_time) end end
do_rename_kde_konsole_tab()
click to toggle source
e(i)
click to toggle source
exit_program()
click to toggle source
register_sigint()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
# File lib/ascii_paradise/clock_counter/clock_counter.rb, line 55 def reset use_colours set_mode # ======================================================================= # # === @rename_kde_konsole_tab # # If the following variable is true then this class will rename the # KDE konsole tab as well. By default this is false, but this # can be changed by the user. # ======================================================================= # @rename_kde_konsole_tab = false end
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/ascii_paradise/clock_counter/clock_counter.rb, line 174 def run consider_requiring_the_kde_konsole_tab_renamer # ======================================================================= # # Our main loop: # ======================================================================= # loop { print `clear` display_time sleep SLEEP_FOR_N_SECONDS break if @run_standalone == :quit } end
set_connected()
click to toggle source
set_mode(i = :standalone)
click to toggle source
use_colours(shall_we_use_colours = true)
click to toggle source