Class: Nanoc::Checking::CommandRunners::Check Private

Inherits:
Nanoc::CLI::CommandRunner
  • Object
show all
Defined in:
lib/nanoc/checking/command_runners/check.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/nanoc/checking/command_runners/check.rb', line 7

def run
  site = load_site

  runner = Nanoc::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
    elsif !arguments.empty?
      runner.run_specific(arguments)
    else
      runner.run_for_deploy
    end

  unless success
    raise Nanoc::Core::TrivialError, 'One or more checks failed'
  end
end