Sha256: d05a9bdf9af6efd46fe5687e6375baa5663209b86f2668ff146da405ab2f3191
Contents?: true
Size: 634 Bytes
Versions: 9
Compression:
Stored size: 634 Bytes
Contents
# frozen_string_literal: true module Overcommit::Hook::PreCommit # Runs `nginx -t` against any modified Nginx config files. # # @see https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/ class NginxTest < Base MESSAGE_REGEX = /^nginx: .+ in (?<file>.+):(?<line>\d+)$/.freeze def run messages = [] applicable_files.each do |file| result = execute(command + ['-c', file]) next if result.success? messages += extract_messages( result.stderr.split("\n").grep(MESSAGE_REGEX), MESSAGE_REGEX ) end messages end end end
Version data entries
9 entries across 9 versions & 2 rubygems