Add and use a singular finder, `find_doc()`

pull/1536/head
Richard Michael 4 years ago
parent c417cecb0c
commit bec0f33b27

@ -267,17 +267,19 @@ class DocsCLI < Thor
private
def find_docs(names)
names.flat_map do |name|
name, version = name.split(/@|~/)
if version == 'all'
Docs.find(name, false).versions
else
Docs.find(name, version)
end
def find_doc(name)
name, version = name.split(/@|~/)
if version == 'all'
Docs.find(name, false).versions
else
Docs.find(name, version)
end
end
def find_docs(names)
names.flat_map {|name| find_doc(name)}
end
def find_docs_by_slugs(slugs)
slugs.flat_map do |slug|
slug, version = slug.split(/~/)

Loading…
Cancel
Save