aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Hildebrandt2015-01-06 20:45:50 +0100
committerJack Nagel2015-01-12 21:08:17 -0500
commit1ed97f2a941bb0a14c8f9a0cba1405cffe0765ab (patch)
tree2efeff931f5defcf208329049ce7fea32214fe30
parent13652562154ff08b7249c2d9dcdf941c07c75b21 (diff)
downloadhomebrew-1ed97f2a941bb0a14c8f9a0cba1405cffe0765ab.tar.bz2
enchant: modernize
* Remove obsolete require 'formula' * Replace single quotes with double quotes * Add test Signed-off-by: Jack Nagel <jacknagel@gmail.com>
-rw-r--r--Library/Formula/enchant.rb42
1 files changed, 24 insertions, 18 deletions
diff --git a/Library/Formula/enchant.rb b/Library/Formula/enchant.rb
index 729793bff..ac3ab155e 100644
--- a/Library/Formula/enchant.rb
+++ b/Library/Formula/enchant.rb
@@ -1,19 +1,17 @@
-require 'formula'
-
class Enchant < Formula
- homepage 'http://www.abisource.com/projects/enchant/'
- url 'http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz'
- sha1 '321f9cf0abfa1937401676ce60976d8779c39536'
+ homepage "http://www.abisource.com/projects/enchant/"
+ url "http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz"
+ sha1 "321f9cf0abfa1937401676ce60976d8779c39536"
- depends_on 'pkg-config' => :build
+ depends_on "pkg-config" => :build
depends_on :python => :optional
- depends_on 'glib'
- depends_on 'aspell'
+ depends_on "glib"
+ depends_on "aspell"
# http://pythonhosted.org/pyenchant/
- resource 'pyenchant' do
- url 'https://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz'
- sha1 '6f01b8657b64e970a11945c2a9b4d6d8023997bc'
+ resource "pyenchant" do
+ url "https://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz"
+ sha1 "6f01b8657b64e970a11945c2a9b4d6d8023997bc"
end
def install
@@ -23,15 +21,23 @@ class Enchant < Formula
"--disable-myspell"
system "make", "install"
- if build.with? 'python'
- resource('pyenchant').stage do
+ if build.with? "python"
+ resource("pyenchant").stage do
# Don't download and install distribute now
- inreplace 'setup.py', "distribute_setup.use_setuptools()", ""
- ENV['PYENCHANT_LIBRARY_PATH'] = lib/'libenchant.dylib'
- system 'python', 'setup.py', 'install', "--prefix=#{prefix}",
- '--single-version-externally-managed',
- '--record=installed.txt'
+ inreplace "setup.py", "distribute_setup.use_setuptools()", ""
+ ENV["PYENCHANT_LIBRARY_PATH"] = lib/"libenchant.dylib"
+ system "python", "setup.py", "install", "--prefix=#{prefix}",
+ "--single-version-externally-managed",
+ "--record=installed.txt"
end
end
end
+
+ test do
+ text = "Teh quikc brwon fox iumpz ovr teh lAzy d0g"
+ enchant_result = text.sub("fox ", "").split.join("\n")
+ file = "test.txt"
+ (testpath/file).write text
+ assert_equal enchant_result, shell_output("#{bin}/enchant -l #{file}").chomp
+ end
end