Class: Jekyll::Commands::Doctor

### Home Classes Methods

### In Files

- lib/jekyll/commands/doctor.rb

### Parent

Jekyll::Command

### Methods

- ::conflicting_urls
- ::deprecated_relative_permalinks
- ::healthy?
- ::process

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Jekyll
- Jekyll::Command
- Jekyll::Commands
- Jekyll::Commands::Build
- Jekyll::Commands::Doctor
- Jekyll::Commands::New
- Jekyll::Commands::Serve
- Jekyll::Configuration
- Jekyll::Converter
- Jekyll::Converters
- Jekyll::Converters::Identity
- Jekyll::Converters::Markdown
- Jekyll::Converters::Markdown::KramdownParser
- Jekyll::Converters::Markdown::MarukuParser
- Jekyll::Converters::Markdown::RDiscountParser
- Jekyll::Converters::Markdown::RedcarpetParser
- Jekyll::Converters::Markdown::RedcarpetParser::CommonMethods
- Jekyll::Converters::Markdown::RedcarpetParser::WithPygments
- Jekyll::Converters::Markdown::RedcarpetParser::WithoutPygments
- Jekyll::Converters::Textile
- Jekyll::Convertible
- Jekyll::Deprecator
- Jekyll::Draft
- Jekyll::Excerpt
- Jekyll::FatalException
- Jekyll::Filters
- Jekyll::Generator
- Jekyll::Generators
- Jekyll::Generators::Pagination
- Jekyll::GistTag
- Jekyll::Layout
- Jekyll::Page
- Jekyll::Pager
- Jekyll::Plugin
- Jekyll::Post
- Jekyll::RelatedPosts
- Jekyll::Site
- Jekyll::Site::Cleaner
- Jekyll::StaticFile
- Jekyll::Stevenson
- Jekyll::Tags
- Jekyll::Tags::HighlightBlock
- Jekyll::Tags::IncludeTag
- Jekyll::Tags::PostComparer
- Jekyll::Tags::PostUrl
- Jekyll::URL
- Date
- Enumerable
- Hash
- Object

No matching classes.

# Jekyll::Commands::Doctor

### Public Class Methods

conflicting_urls(site) click to toggle source

    # 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) click to toggle source

    # 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) click to toggle source

    # File lib/jekyll/commands/doctor.rb, line 16
    def healthy?(site)
      [
        !deprecated_relative_permalinks(site),
        !conflicting_urls(site)
      ].all?
    end

process(options) click to toggle source

    # File lib/jekyll/commands/doctor.rb, line 5
    def process(options)
      site = Jekyll::Site.new(options)
      site.read

      if healthy?(site)
        Jekyll.logger.info "Your test results", "are in. Everything looks fine."
      else
        abort
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.