aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/bsdconv.rb
blob: 9c2ef764c29248f20007abfd0bec0d2e25c50055 (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
# encoding: UTF-8

require 'formula'

class Bsdconv < Formula
  homepage 'https://github.com/buganini/bsdconv'
  url 'https://github.com/buganini/bsdconv/archive/9.1.tar.gz'
  sha1 '0c76fa6ea9f5922a705826f95a99c36dd951845a'

  head 'https://github.com/buganini/bsdconv.git'

  def install
    system "make", "PREFIX=#{prefix}"
    system "make", "PREFIX=#{prefix}", "install"
  end

  test do
    require 'open3'
    Open3.popen3("#{bin}/bsdconv", "big5:utf-8") do |stdin, stdout, _|
      stdin.write("\263\134\245\134\273\134")
      stdin.close
      stdout.read == "許功蓋"
    end
  end
end