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/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/code/view.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/oss/download.rb,
lib/lhj/command/pgyer_upload.rb,
lib/lhj/command/rename_image.rb,
lib/lhj/command/jenkins_build.rb,
lib/lhj/command/sync_pod_repo.rb,
lib/lhj/command/reverse_import.rb,
lib/lhj/command/refactor_rename.rb,
lib/lhj/command/sync_pod_version.rb,
lib/lhj/command/code/code_template.rb,
lib/lhj/command/duplicate_imageset.rb,
lib/lhj/command/local/local_upload.rb,
lib/lhj/command/local/micro_service.rb
Overview
Direct Known Subclasses
CodeTemplate, Config, DuplicateImageset, Fetch, Filepath, Filter, HeaderImport, Http, Init, JenkinsBuild, Local, OSS, Pgyer, Refactor, RenameImage, ReverseImport, Service, SyncPod, SyncPodVersion, Trans, View, Yapi
Defined Under Namespace
Classes: CodeTemplate, Config, DuplicateImageset, Fetch, Filepath, Filter, HeaderImport, Http, Init, JenkinsBuild, Local, OSS, Pgyer, Refactor, RenameImage, ReverseImport, Service, SyncPod, SyncPodVersion, Trans, View, Yapi
Instance Method Summary
collapse
Constructor Details
#initialize(argv) ⇒ Command
Returns a new instance of Command.
51
52
53
54
|
# File 'lib/lhj/command.rb', line 51
def initialize(argv)
super(argv)
@spinner = TTY::Spinner.new('[:spinner]...', output: $stdout, format: :dots, clear: true)
end
|
Instance Method Details
#auto_spin ⇒ Object
41
42
43
44
|
# File 'lib/lhj/command.rb', line 41
def auto_spin
puts begin_title.green
end
|
#begin_title ⇒ Object
37
38
39
|
# File 'lib/lhj/command.rb', line 37
def begin_title
'开始处理...'
end
|
#handle ⇒ Object
62
63
64
|
# File 'lib/lhj/command.rb', line 62
def handle
raise 'A subclass should override the `Lhj::Command#run` method'
end
|
#run ⇒ Object
56
57
58
59
60
|
# File 'lib/lhj/command.rb', line 56
def run
auto_spin
handle
stop
end
|
#stop ⇒ Object
46
47
48
49
|
# File 'lib/lhj/command.rb', line 46
def stop
puts '处理完成'.green
end
|