Class: Lhj::Command
- Inherits:
-
CLAide::Command
- Object
- CLAide::Command
- Lhj::Command
show all
- Defined in:
- lib/lhj/command.rb,
lib/lhj/command/oss.rb,
lib/lhj/command/http.rb,
lib/lhj/command/init.rb,
lib/lhj/command/view.rb,
lib/lhj/command/yapi.rb,
lib/lhj/command/trans.rb,
lib/lhj/command/config.rb,
lib/lhj/command/oss/del.rb,
lib/lhj/command/oss/list.rb,
lib/lhj/command/template.rb,
lib/lhj/command/file_path.rb,
lib/lhj/command/oss/upload.rb,
lib/lhj/command/config/info.rb,
lib/lhj/command/head_import.rb,
lib/lhj/command/local/fetch.rb,
lib/lhj/command/local/local.rb,
lib/lhj/command/local/filter.rb,
lib/lhj/command/pgyer_upload.rb,
lib/lhj/command/rename_image.rb,
lib/lhj/command/sync_pod_repo.rb,
lib/lhj/command/reverse_import.rb,
lib/lhj/command/refactor_rename.rb,
lib/lhj/command/local/local_upload.rb,
lib/lhj/command/local/micro_service.rb
Overview
Direct Known Subclasses
Config, Fetch, Filepath, Filter, HeaderImport, Http, Init, Local, OSS, Pgyer, Refactor, RenameImage, ReverseImport, Service, SyncPod, Trans, View, Yapi
Defined Under Namespace
Classes: Config, Fetch, Filepath, Filter, HeaderImport, Http, Init, Local, OSS, Pgyer, Refactor, RenameImage, ReverseImport, Service, SyncPod, Trans, View, Yapi
Instance Method Summary
collapse
Constructor Details
#initialize(argv) ⇒ Command
Returns a new instance of Command.
46
47
48
49
|
# File 'lib/lhj/command.rb', line 46
def initialize(argv)
super(argv)
@spinner = TTY::Spinner.new('[:spinner]...', output: $stdout, format: :dots, clear: true)
end
|
Instance Method Details
#auto_spin ⇒ Object
36
37
38
39
|
# File 'lib/lhj/command.rb', line 36
def auto_spin
puts begin_title.green
end
|
#begin_title ⇒ Object
32
33
34
|
# File 'lib/lhj/command.rb', line 32
def begin_title
'开始处理...'
end
|
#handle ⇒ Object
57
58
59
|
# File 'lib/lhj/command.rb', line 57
def handle
raise 'A subclass should override the `Lhj::Command#run` method'
end
|
#run ⇒ Object
51
52
53
54
55
|
# File 'lib/lhj/command.rb', line 51
def run
auto_spin
handle
stop
end
|
#stop ⇒ Object
41
42
43
44
|
# File 'lib/lhj/command.rb', line 41
def stop
puts '处理完成'.green
end
|