File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,14 @@ class DocsCLI < Thor
15
15
option :packaged , type : :boolean
16
16
def list
17
17
if options [ :packaged ]
18
- names = Dir [ File . join ( Docs . store_path , '*.tar.gz' ) ] . map { |f | File . basename ( f , '.tar.gz' ) }
19
- puts names
18
+ slugs = Dir [ File . join ( Docs . store_path , '*.tar.gz' ) ] . map { |f | File . basename ( f , '.tar.gz' ) }
19
+ names = find_docs_by_slugs ( slugs ) . map do |doc |
20
+ name = if doc . version?
21
+ "#{ doc . superclass . to_s . demodulize . underscore } @#{ doc . version } "
22
+ else
23
+ doc . to_s . demodulize . underscore
24
+ end
25
+ end
20
26
else
21
27
names = Docs . all . flat_map do |doc |
22
28
name = doc . to_s . demodulize . underscore
@@ -26,12 +32,12 @@ class DocsCLI < Thor
26
32
name
27
33
end
28
34
end
35
+ end
29
36
30
- output = names . join ( "\n " )
37
+ output = names . join ( "\n " )
31
38
32
- require 'tty-pager'
33
- TTY ::Pager . new . page ( output )
34
- end
39
+ require 'tty-pager'
40
+ TTY ::Pager . new . page ( output )
35
41
end
36
42
37
43
desc 'page <doc> [path] [--version] [--verbose] [--debug]' , 'Generate a page (no indexing)'
You can’t perform that action at this time.
0 commit comments