Class: Jekyll::Commands::Doctor

Inherits:
Jekyll::Command show all
Defined in:
lib/jekyll/commands/doctor.rb

Class Method Summary collapse

Methods inherited from Jekyll::Command

globs, process_site

Class Method Details



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/jekyll/commands/doctor.rb', line 14

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.1 and beyond."
      contains_deprecated_pages = true
    end
  end
  contains_deprecated_pages
end

.process(options) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/jekyll/commands/doctor.rb', line 5

def process(options)
  site = Jekyll::Site.new(options)
  site.read

  unless deprecated_relative_permalinks(site)
    Jekyll.logger.info "Your test results", "are in. Everything looks fine."
  end
end