2015-03-23 00:21:10 +00:00
|
|
|
class Scriptcs < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Tools to write and execute C#"
|
2015-03-23 00:21:10 +00:00
|
|
|
homepage "https://github.com/scriptcs/scriptcs"
|
2015-08-03 17:09:33 +00:00
|
|
|
url "https://github.com/scriptcs/scriptcs/archive/v0.15.0.tar.gz"
|
|
|
|
sha256 "658d4ef2c23253ba1d2717c947d2985cb506ce69425280ee8e62cc50d15d6803"
|
2015-03-23 00:21:10 +00:00
|
|
|
|
2015-03-23 02:48:23 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-08-03 20:04:45 +00:00
|
|
|
sha256 "dfead67e3f9fbdb499b480eb2b29d651010b1815ef5fe0425affd4ce07295739" => :yosemite
|
|
|
|
sha256 "eec5baf497fc37444fc37adf7c7c761011bb50059f21ccaf10620f0887e759f6" => :mavericks
|
|
|
|
sha256 "206b8fd283ab15e49c91941c2dad77950adb5a9642bb8563a530f4a79d2ccaf3" => :mountain_lion
|
2015-03-23 02:48:23 +00:00
|
|
|
end
|
|
|
|
|
2015-03-23 00:21:10 +00:00
|
|
|
depends_on "mono" => :recommended
|
|
|
|
|
|
|
|
def install
|
|
|
|
script_file = "scriptcs.sh"
|
|
|
|
system "./build.sh"
|
|
|
|
libexec.install Dir["src/ScriptCs/bin/Release/*"]
|
|
|
|
(libexec/script_file).write <<-EOS.undent
|
2015-03-23 08:48:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
mono #{libexec}/scriptcs.exe $@
|
2015-03-23 00:21:10 +00:00
|
|
|
EOS
|
|
|
|
(libexec/script_file).chmod 0755
|
|
|
|
bin.install_symlink libexec/script_file => "scriptcs"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
test_file = "tests.csx"
|
|
|
|
(testpath/test_file).write('Console.WriteLine("{0}, {1}!", "Hello", "world");')
|
|
|
|
assert_equal "Hello, world!", `scriptcs #{test_file}`.strip
|
|
|
|
end
|
|
|
|
end
|