Tweak docs:generate warning

pull/412/merge
Thibaut Courouble 9 years ago
parent 034ecfae72
commit 2ccfc3f6c2

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

Loading…
Cancel
Save