2013-03-02 23:42:21 +00:00
|
|
|
# encoding: UTF-8
|
|
|
|
|
2012-04-05 13:22:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Bsdconv < Formula
|
|
|
|
homepage 'https://github.com/buganini/bsdconv'
|
2014-05-13 14:40:12 +00:00
|
|
|
url 'https://github.com/buganini/bsdconv/archive/11.3.1.tar.gz'
|
|
|
|
sha1 'cec116e2a13b85abafa15011301fb539d2fd5244'
|
2012-04-05 13:22:42 +00:00
|
|
|
|
|
|
|
head 'https://github.com/buganini/bsdconv.git'
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "make", "PREFIX=#{prefix}"
|
|
|
|
system "make", "PREFIX=#{prefix}", "install"
|
|
|
|
end
|
|
|
|
|
2013-03-25 04:39:48 +00:00
|
|
|
test do
|
|
|
|
require 'open3'
|
|
|
|
Open3.popen3("#{bin}/bsdconv", "big5:utf-8") do |stdin, stdout, _|
|
|
|
|
stdin.write("\263\134\245\134\273\134")
|
|
|
|
stdin.close
|
2014-06-04 20:51:21 +00:00
|
|
|
result = stdout.read
|
|
|
|
result.force_encoding(Encoding::UTF_8) if result.respond_to?(:force_encoding)
|
|
|
|
assert_equal "許功蓋", result
|
2013-03-25 04:39:48 +00:00
|
|
|
end
|
2012-04-05 13:22:42 +00:00
|
|
|
end
|
|
|
|
end
|