Sha256: 9326b02cae84ffade62933a77d979b114db8860b14ad45821522f99a03648cff

Contents?: true

Size: 391 Bytes

Versions: 9

Compression:

Stored size: 391 Bytes

Contents

module PreCommit
  class Runner

    def run
      checks_to_run = PreCommit.checks_to_run

      all_passed = checks_to_run.inject(true) do |current_status, check|
        passed = check.call

        if !passed && check.respond_to?(:error_message)
          puts check.error_message
        end

        check && current_status
      end

      exit(all_passed ? 0 : 1)
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pre-commit-0.12.0 lib/pre-commit/runner.rb
pre-commit-0.11.0 lib/pre-commit/runner.rb
pre-commit-0.10.0 lib/pre-commit/runner.rb
pre-commit-0.9.2 lib/pre-commit/runner.rb
pre-commit-0.9.1 lib/pre-commit/runner.rb
pre-commit-0.9.0 lib/pre-commit/runner.rb
pre-commit-0.8.1 lib/pre-commit/runner.rb
pre-commit-0.8.0 lib/pre-commit/runner.rb
pre-commit-0.7.0 lib/pre-commit/runner.rb