Skip to content

Commit

Permalink
dfmt 0.4.1
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#45242.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
  • Loading branch information
John-Colvin authored and bfontaine committed Oct 23, 2015
1 parent 1119677 commit 37eda7d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Formula/dfmt.rb
@@ -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

0 comments on commit 37eda7d

Please sign in to comment.