Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes Homebrew/legacy-homebrew#45242. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
- Loading branch information
1 parent
1119677
commit 37eda7d
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Dfmt < Formula | ||
desc "Formatter for D source code" | ||
homepage "https://github.com/Hackerpilot/dfmt" | ||
url "https://github.com/Hackerpilot/dfmt.git", | ||
:tag => "v0.4.1", | ||
:revision => "5ce683bab21598db69e399768ecd143caa57ef34" | ||
head "https://github.com/Hackerpilot/dfmt.git", :shallow => false | ||
|
||
depends_on "dmd" => :build | ||
|
||
def install | ||
system "make" | ||
bin.install "bin/dfmt" | ||
end | ||
|
||
test do | ||
(testpath/"test.d").write <<-EOS.undent | ||
import std.stdio; void main() { writeln("Hello, world without explicit compilations!"); } | ||
EOS | ||
|
||
expected = <<-EOS.undent | ||
import std.stdio; | ||
void main() | ||
{ | ||
writeln("Hello, world without explicit compilations!"); | ||
} | ||
EOS | ||
|
||
system "#{bin}/dfmt", "-i", "test.d" | ||
|
||
assert_equal expected, (testpath/"test.d").read | ||
end | ||
end |