lib/lhj/command.rb in lhj-tools-0.1.4 vs lib/lhj/command.rb in lhj-tools-0.1.5
- old
+ new
@@ -1,6 +1,7 @@
require 'claide'
+require "tty-spinner"
module Lhj
# command plugin
class Command < CLAide::Command
require 'lhj/command/init'
@@ -20,7 +21,20 @@
require 'lhj/command/trans'
require 'lhj/command/yapi'
self.abstract_command = true
self.command = 'lhj'
+
+ def spinner
+ @spinner ||= TTY::Spinner.new('[:spinner]正在处理...', format: :dots)
+ end
+
+ def auto_spin
+ spinner.auto_spin
+ end
+
+ def stop
+ spinner.stop('Done!')
+ end
+
end
end