Sha256: 0297fb797c0ba36fcb0ef3662df99954071f368c56c4fc34cbba8d32b65eab06
Contents?: true
Size: 705 Bytes
Versions: 19
Compression:
Stored size: 705 Bytes
Contents
require 'pre-commit/checks/plugin' module PreCommit module Checks class Closure < Plugin #TODO: add pluginator assets support CLOSURE_PATH = File.expand_path("../../../../pre-commit/support/closure/compiler.jar", __FILE__) def self.aliases [:closure_syntax_check] end def call(staged_files) return if staged_files.empty? js_args = staged_files.map {|arg| "--js #{arg}"}.join(' ') errors = `java -jar #{CLOSURE_PATH} #{js_args} --js_output_file /tmp/jammit.js 2>&1`.strip return if errors.empty? errors end def self.description "Runs closure compiler to detect errors" end end end end
Version data entries
19 entries across 19 versions & 1 rubygems