History

Add support for '@all' version shortcut in thor commands

Thibaut Courouble committed 8 years ago

Commit 45c70fb1 parent 0bf71551 file · +6 −2Browse files

Unified · Split

lib/tasks/docs.thor+6−2
@@ -175,9 +175,13 @@ class DocsCLI < Thor · 174 unmodified lines
175175 private
176176
177177 def find_docs(names)
178− names.map do |name|
178+ names.flat_map do |name|
179179 name, version = name.split(/@|~/)
180− Docs.find(name, version)
180+ if version == 'all'
181+ Docs.find(name, false).versions
182+ else
183+ Docs.find(name, version)
184+ end
181185 end
182186 end
183187