Class/Module Index [+]

Quicksearch

Nanoc::CLI::Commands::Check

Public Instance Methods

run() click to toggle source
# File lib/nanoc/cli/commands/check.rb, line 16
def run
  validate_options_and_arguments
  self.require_site

  runner = Nanoc::Extra::Checking::Runner.new(site)

  if options[:list]
    runner.list_checks
    return
  end

  success = if options[:all]
    runner.run_all
  elsif options[:deploy]
    runner.run_for_deploy
  else
    runner.run_specific(arguments)
  end

  unless success
    raise Nanoc::Errors::GenericTrivial, 'One or more checks failed'
  end
end

Protected Instance Methods

validate_options_and_arguments() click to toggle source
# File lib/nanoc/cli/commands/check.rb, line 42
def validate_options_and_arguments
  if arguments.empty? && !options[:all] && !options[:deploy] && !options[:list]
    raise Nanoc::Errors::GenericTrivial,
      "nothing to do (pass either --all, --deploy or --list or a list of checks)"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.