aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/lolcode.rb
blob: b104bdca1b96388bb057c7673c1d417293f814ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'formula'

class Lolcode < Formula
  homepage 'http://lolcode.org'
  head 'https://github.com/justinmeza/lolcode.git'
  url 'https://github.com/justinmeza/lci/archive/v0.11.1.tar.gz'
  sha1 '9949a2480a738ac566dbe66142dd351f778fb8b7'

  depends_on 'cmake' => :build

  conflicts_with 'lci', :because => 'both install `lci` binaries'

  def install
    system "cmake ."
    system "make"
    # Don't use `make install` for this one file
    bin.install 'lci'
  end

  test do
    path = testpath/"test.lol"
    path.write <<-EOS.undent
      HAI 1.2
      CAN HAS STDIO?
      VISIBLE "HAI WORLD"
      KTHXBYE
    EOS

    output = `#{bin}/lci #{path}`
    assert_equal "HAI WORLD\n", output
    assert_equal 0, $?.exitstatus
  end
end