Class: Jekyll::Commands::Doctor
- Inherits:
-
Jekyll::Command
- Object
- Jekyll::Command
- Jekyll::Commands::Doctor
- Defined in:
- lib/jekyll/commands/doctor.rb
Class Method Summary collapse
- .conflicting_urls(site) ⇒ Object
- .deprecated_relative_permalinks(site) ⇒ Object
- .healthy?(site) ⇒ Boolean
- .process(options) ⇒ Object
Methods inherited from Jekyll::Command
Class Method Details
.conflicting_urls(site) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/jekyll/commands/doctor.rb', line 36 def conflicting_urls(site) conflicting_urls = false urls = {} urls = collect_urls(urls, site.pages, site.dest) urls = collect_urls(urls, site.posts, site.dest) urls.each do |url, paths| if paths.size > 1 conflicting_urls = true Jekyll.logger.warn "Conflict:", "The URL '#{url}' is the destination" + " for the following pages: #{paths.join(", ")}" end end conflicting_urls end |
.deprecated_relative_permalinks(site) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jekyll/commands/doctor.rb', line 23 def deprecated_relative_permalinks(site) contains_deprecated_pages = false site.pages.each do |page| if page.uses_relative_permalinks Jekyll.logger.warn "Deprecation:", "'#{page.path}' uses relative" + " permalinks which will be deprecated in" + " Jekyll v1.2 and beyond." contains_deprecated_pages = true end end contains_deprecated_pages end |
.healthy?(site) ⇒ Boolean
16 17 18 19 20 21 |
# File 'lib/jekyll/commands/doctor.rb', line 16 def healthy?(site) [ !deprecated_relative_permalinks(site), !conflicting_urls(site) ].all? end |