2014-11-03 01:11:53 +00:00
|
|
|
class ClosureLinter < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Check JavaScript files for style and documentation"
|
2014-11-03 01:11:53 +00:00
|
|
|
homepage "https://developers.google.com/closure/utilities/"
|
2015-08-10 04:24:12 +00:00
|
|
|
url "https://github.com/google/closure-linter/archive/v2.3.19.tar.gz"
|
|
|
|
sha256 "cd472f560be5af80afccbe94c9d9b534f7c30085510961ad408f8a314ea5c4c2"
|
2015-06-27 17:40:49 +00:00
|
|
|
|
|
|
|
head "https://github.com/google/closure-linter.git"
|
2014-11-03 01:11:53 +00:00
|
|
|
|
2014-11-03 07:10:59 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-08-10 05:25:08 +00:00
|
|
|
sha256 "1fba2b6ce208cc1944ecb7aaf1e4998f439f248234f51854523b04be96babb8d" => :yosemite
|
|
|
|
sha256 "a5f04eab15b5496bc5309b420552a2f13392606bab465beaf0cce27119557b61" => :mavericks
|
|
|
|
sha256 "beaed6105607c8d7096707904aa6b1d51dfe3f119d709ddb6d0dba93691323bb" => :mountain_lion
|
2014-11-03 07:10:59 +00:00
|
|
|
end
|
|
|
|
|
2014-11-03 01:11:53 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
|
|
|
|
resource "python-gflags" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/python-gflags/python-gflags-2.0.tar.gz"
|
2015-06-27 17:40:49 +00:00
|
|
|
sha256 "0dff6360423f3ec08cbe3bfaf37b339461a54a21d13be0dd5d9c9999ce531078"
|
2014-11-03 01:11:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["PYTHONPATH"] = libexec+"lib/python2.7/site-packages"
|
|
|
|
|
|
|
|
resources.each do |r|
|
2015-06-27 17:40:49 +00:00
|
|
|
r.stage { system "python", *Language::Python.setup_install_args(libexec) }
|
2014-11-03 01:11:53 +00:00
|
|
|
end
|
|
|
|
|
2015-06-27 17:40:49 +00:00
|
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
2014-11-03 01:11:53 +00:00
|
|
|
|
|
|
|
bin.install Dir[libexec/"bin/*js*"]
|
|
|
|
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.js").write("var test = 1;\n")
|
2015-08-10 04:24:12 +00:00
|
|
|
assert_equal "1 files checked, no errors found.", shell_output("#{bin}/gjslint test.js").chomp
|
2014-11-03 01:11:53 +00:00
|
|
|
system "#{bin}/fixjsstyle", "test.js"
|
|
|
|
end
|
|
|
|
end
|