|
|
|
@ -62,23 +62,25 @@ class DocsCLI < Thor
|
|
|
|
|
Docs.install_report :scraper if options[:debug]
|
|
|
|
|
Docs.install_report :progress_bar, :doc if $stdout.tty?
|
|
|
|
|
|
|
|
|
|
unless options[:force]
|
|
|
|
|
require 'unix_utils' if options[:package]
|
|
|
|
|
|
|
|
|
|
doc = Docs.find(name, options[:version])
|
|
|
|
|
|
|
|
|
|
if doc < Docs::UrlScraper && !options[:force]
|
|
|
|
|
puts <<-TEXT.strip_heredoc
|
|
|
|
|
Note: this command will scrape the documentation from the source.
|
|
|
|
|
Some scrapers require a local setup. Others will send thousands of
|
|
|
|
|
HTTP requests, potentially slowing down the source site.
|
|
|
|
|
Please don't use it unless you are modifying the code.
|
|
|
|
|
/!\\ WARNING /!\\
|
|
|
|
|
|
|
|
|
|
Some scrapers send thousands of HTTP requests in a short period of time,
|
|
|
|
|
which can slow down the source site and trouble its maintainers.
|
|
|
|
|
|
|
|
|
|
To download the latest tested version of a documentation, use:
|
|
|
|
|
Please scrape responsibly. Don't do it unless you're modifying the code.
|
|
|
|
|
|
|
|
|
|
To download the latest tested version of this documentation, run:
|
|
|
|
|
thor docs:download #{name}\n
|
|
|
|
|
TEXT
|
|
|
|
|
return unless yes? 'Proceed? (y/n)'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
require 'unix_utils' if options[:package]
|
|
|
|
|
|
|
|
|
|
doc = Docs.find(name, options[:version])
|
|
|
|
|
|
|
|
|
|
result = if doc.version && options[:all]
|
|
|
|
|
doc.superclass.versions.all? do |_doc|
|
|
|
|
|
puts "==> #{_doc.version}"
|
|
|
|
|