2012-04-05 13:22:42 +00:00
|
|
|
class Bsdconv < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Charset/encoding converter library"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "https://github.com/buganini/bsdconv"
|
|
|
|
url "https://github.com/buganini/bsdconv/archive/11.3.1.tar.gz"
|
|
|
|
sha256 "b0656011fd40ec440e9966bba44d330a6213fdd198c487c87bc61869ef7fea9e"
|
2012-04-05 13:22:42 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
head "https://github.com/buganini/bsdconv.git"
|
2012-04-05 13:22:42 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
system "make", "PREFIX=#{prefix}"
|
|
|
|
system "make", "PREFIX=#{prefix}", "install"
|
|
|
|
end
|
|
|
|
|
2013-03-25 04:39:48 +00:00
|
|
|
test do
|
2015-08-03 12:55:31 +00:00
|
|
|
require "open3"
|
2013-03-25 04:39:48 +00:00
|
|
|
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
|