2011-03-10 05:11:03 +00:00
|
|
|
class Astyle < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Source code beautifier for C, C++, C#, and Java"
|
2014-11-17 08:34:06 +00:00
|
|
|
homepage "http://astyle.sourceforge.net/"
|
2015-08-06 11:25:22 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/astyle/astyle/astyle%202.05.1/astyle_2.05.1_macosx.tar.gz"
|
|
|
|
sha256 "de66da286dee2b9de1dc1c05092cbf5368c0889f25d1e2ee8b51766aff8e4baf"
|
2014-11-17 08:34:06 +00:00
|
|
|
head "svn://svn.code.sf.net/p/astyle/code/trunk/AStyle"
|
2009-06-14 23:55:32 +00:00
|
|
|
|
2014-11-17 08:51:38 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-08-06 11:53:03 +00:00
|
|
|
sha256 "b0eaa29cb1899f79cdf30bc301754e50167471bd3e0427fc01e943bca2e2cdb2" => :yosemite
|
|
|
|
sha256 "ce0c6f4c815d5eeaf547fcc7efb5e869ccba36ae80ebc30c6b96470ba73f02ff" => :mavericks
|
|
|
|
sha256 "706419e9e1d02f93c67c68dbe10db43e1701c45106749ce79f952c3ddde73e98" => :mountain_lion
|
2014-11-17 08:51:38 +00:00
|
|
|
end
|
|
|
|
|
2009-06-14 23:55:32 +00:00
|
|
|
def install
|
2014-11-17 08:34:06 +00:00
|
|
|
cd "src" do
|
2012-03-11 21:55:21 +00:00
|
|
|
system "make", "CXX=#{ENV.cxx}", "-f", "../build/mac/Makefile"
|
2010-04-07 05:58:35 +00:00
|
|
|
bin.install "bin/astyle"
|
2009-06-14 23:55:32 +00:00
|
|
|
end
|
|
|
|
end
|
2014-12-29 07:45:57 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write("int main(){return 0;}\n")
|
|
|
|
system "#{bin}/astyle", "--style=gnu", "--indent=spaces=4",
|
|
|
|
"--lineend=linux", "#{testpath}/test.c"
|
|
|
|
assert_equal File.read("test.c"), <<-EOS.undent
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
end
|
2011-01-26 00:35:02 +00:00
|
|
|
end
|