Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

kurukuru time

  • Loading branch information...
commit 9bcf6c7420e1a93d836e419f1e8d81b593acedc7 1 parent 1513376
jugyo authored
Showing with 39 additions and 14 deletions.
  1. +39 −14 lib/termtter/client.rb
View
53 lib/termtter/client.rb
@@ -301,28 +301,53 @@ def parse_options
end
def show_splash
+ print "\e[0G\e[2K"
puts TermColor.parse(config.splash)
end
+ def start_kurukuru
+ Thread.start do
+ l = '/ - \ |'.split
+ loop do
+ c = l.shift
+ print "\e[0G#{c}"
+ STDOUT.flush
+ sleep 0.1
+ l.push c
+ end
+ end
+ end
+
def run
parse_options
- config.__freeze__(:user_name) unless config.user_name.empty?
- show_splash
- load_config
- setup_task_manager
- load_plugins
- eval_init_block
- config.__unfreeze__(:user_name)
- Termtter::API.setup
-
- config.system.eval_scripts.each do |script|
- begin
- eval script
- rescue Exception => e
- handle_error(e)
+
+ begin
+ print "\e[?25l"
+ config.__freeze__(:user_name) unless config.user_name.empty?
+ kurukuru = start_kurukuru
+ load_config
+ setup_task_manager
+ load_plugins
+ eval_init_block
+ config.__unfreeze__(:user_name)
+ Termtter::API.setup
+ config.system.eval_scripts.each do |script|
+ begin
+ eval script
+ rescue Exception => e
+ handle_error(e)
+ end
end
+
+ sleep 3 # kurukuru time!
+
+ kurukuru.exit
+ ensure
+ print "\e[?25h"
end
+ show_splash
+
config.system.run_commands.each {|cmd| execute(cmd) }
unless config.system.cmd_mode
Please sign in to comment.
Something went wrong with that request. Please try again.