Sha256: c8961ae9037406953bf9a0b6282a1dd7ccf14ecc39e036c522185a258909eed0

Contents?: true

Size: 548 Bytes

Versions: 11

Compression:

Stored size: 548 Bytes

Contents

module ReVIEW
  module CallHook
    def call_hook(hook_name, *params, base_dir: nil)
      maker = @config.maker
      filename = @config.dig(maker, hook_name)
      return unless filename

      hook = File.absolute_path(filename, base_dir)
      @logger.debug("Call #{hook_name}. (#{hook})")

      return if !File.exist?(hook) || !FileTest.executable?(hook)

      if ENV['REVIEW_SAFE_MODE'].to_i & 1 > 0
        warn 'hook configuration is prohibited in safe mode. ignored.'
      else
        system(hook, *params)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
review-5.10.0 lib/review/call_hook.rb
review-5.9.0 lib/review/call_hook.rb
review-5.8.0 lib/review/call_hook.rb
review-5.7.0 lib/review/call_hook.rb
review-5.6.0 lib/review/call_hook.rb
review-5.5.0 lib/review/call_hook.rb
review-5.4.0 lib/review/call_hook.rb
review-5.3.0 lib/review/call_hook.rb
review-5.2.0 lib/review/call_hook.rb
review-5.1.1 lib/review/call_hook.rb
review-5.1.0 lib/review/call_hook.rb