File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,14 @@ class DocsCLI < Thor
1515 option :packaged , type : :boolean
1616 def list
1717 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
2026 else
2127 names = Docs . all . flat_map do |doc |
2228 name = doc . to_s . demodulize . underscore
@@ -26,12 +32,12 @@ class DocsCLI < Thor
2632 name
2733 end
2834 end
35+ end
2936
30- output = names . join ( "\n " )
37+ output = names . join ( "\n " )
3138
32- require 'tty-pager'
33- TTY ::Pager . new . page ( output )
34- end
39+ require 'tty-pager'
40+ TTY ::Pager . new . page ( output )
3541 end
3642
3743 desc 'page <doc> [path] [--version] [--verbose] [--debug]' , 'Generate a page (no indexing)'
You can’t perform that action at this time.
0 commit comments