Class: Kscript::KkProjectScanUtils
- Inherits:
-
Base
- Object
- Base
- Kscript::KkProjectScanUtils
show all
- Defined in:
- lib/kscript/plugins/kk_project_scan_utils.rb
Instance Attribute Summary
Attributes inherited from Base
#logger
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#human_output?, inherited, #with_error_handling
Constructor Details
Returns a new instance of KkProjectScanUtils.
12
13
14
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 12
def initialize(*args, **opts)
super
end
|
Class Method Details
.arguments ⇒ Object
33
34
35
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 33
def self.arguments
'[src_path]'
end
|
.author ⇒ Object
45
46
47
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 45
def self.author
'kk'
end
|
.description ⇒ Object
29
30
31
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 29
def self.description
'Scan and list all git projects in a directory.'
end
|
.group ⇒ Object
41
42
43
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 41
def self.group
'project'
end
|
.usage ⇒ Object
37
38
39
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 37
def self.usage
"kscript project_scan ~/projects/src\nkscript project_scan /opt --type=go"
end
|
Instance Method Details
#run(*args, **_opts) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 16
def run(*args, **_opts)
with_error_handling do
@src_path = args[0] || @src_path || Dir.pwd
scan_and_display
end
end
|
#scan_and_display ⇒ Object
23
24
25
26
27
|
# File 'lib/kscript/plugins/kk_project_scan_utils.rb', line 23
def scan_and_display
ensure_directory_exists
projects = scan_projects
display_projects(projects)
end
|