aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/betty.rb
blob: cf097b42d4a497e5a5b8189cf8eee29a7c9d712c (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
34
35
require "formula"

class Ruby19Dependency < Requirement
  fatal true
  default_formula "ruby"

  satisfy do
    `ruby --version` =~ /ruby (\d\.\d).\d/
    $1.to_f >= 1.9
  end

  def message
    "Betty requires Ruby 1.9 or better."
  end
end

class Betty < Formula
  homepage "https://github.com/pickhardt/betty"
  url "https://github.com/pickhardt/betty/archive/v0.1.4.tar.gz"
  sha1 "f31c4ab02036e82b07116b821193e32287029908"

  depends_on Ruby19Dependency

  def install
    libexec.install "lib", "main.rb" => "betty"
    bin.write_exec_script libexec/"betty"
  end

  test do
    system bin/"betty", "speech on"
    system bin/"betty", "what is your name"
    system bin/"betty", "version"
    system bin/"betty", "speech off"
  end
end