aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Formula/ack.rb3
-rw-r--r--Library/Formula/android-sdk.rb17
-rw-r--r--Library/Formula/mysql.rb53
-rw-r--r--Library/Formula/ruby-enterprise-edition.rb16
-rw-r--r--Library/Formula/sip.rb11
-rw-r--r--Library/Formula/thrift.rb6
-rw-r--r--Library/Homebrew/extend/ARGV.rb51
-rw-r--r--Library/Homebrew/extend/string.rb15
-rw-r--r--Library/Homebrew/global.rb1
9 files changed, 92 insertions, 81 deletions
diff --git a/Library/Formula/ack.rb b/Library/Formula/ack.rb
index 27f730947..2a418a344 100644
--- a/Library/Formula/ack.rb
+++ b/Library/Formula/ack.rb
@@ -1,9 +1,6 @@
require 'formula'
class Ack <ScriptFileFormula
- # NOTE you don't need to specify the version, usually it is determined
- # automatically by examination of the URL, however in this case our auto
- # determination magic is inadequete
version '1.92'
url "http://github.com/petdance/ack/raw/f5556c48eb46100e1733f5a21b45a00f6c190061/ack"
md5 '7175438fbcb43405f50d7ffda701eeb3'
diff --git a/Library/Formula/android-sdk.rb b/Library/Formula/android-sdk.rb
index a04477d3d..9961ec85a 100644
--- a/Library/Formula/android-sdk.rb
+++ b/Library/Formula/android-sdk.rb
@@ -25,13 +25,14 @@ class AndroidSdk <Formula
end
end
- def caveats; <<-EOS
-We agreed to the Android SDK License Agreement for you by downloading the SDK.
-If this is unacceptable you should uninstall.
-You can read the license at: http://developer.android.com/sdk/terms.html
-
-Please add this line to your .bash_profile:
- export ANDROID_SDK_ROOT=#{prefix}
-EOS
+ def caveats; <<-EOS.undent
+ We agreed to the Android SDK License Agreement for you when we downloaded the
+ SDK. If this is unacceptable you should uninstall. You can read the license
+ at: http://developer.android.com/sdk/terms.html
+
+ Please add this line to your .bash_profile:
+
+ export ANDROID_SDK_ROOT=#{prefix}
+ EOS
end
end
diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb
index 8eb604fb2..488ab187a 100644
--- a/Library/Formula/mysql.rb
+++ b/Library/Formula/mysql.rb
@@ -55,38 +55,37 @@ class Mysql <Formula
(prefix+'com.mysql.mysqld.plist').write startup_plist
end
- def caveats; <<-EOS
-Set up databases with:
- mysql_install_db
+ def caveats; <<-EOS.undent
+ Set up databases with:
+ mysql_install_db
-Automatically load on login with:
- launchctl load -w #{prefix}/com.mysql.mysqld.plist
+ Automatically load on login with:
+ launchctl load -w #{prefix}/com.mysql.mysqld.plist
-Or start manually with:
- #{prefix}/share/mysql/mysql.server start
+ Or start manually with:
+ #{prefix}/share/mysql/mysql.server start
EOS
end
- def startup_plist
- return <<-EOPLIST
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>KeepAlive</key>
- <true/>
- <key>Label</key>
- <string>com.mysql.mysqld</string>
- <key>Program</key>
- <string>#{bin}/mysqld_safe</string>
- <key>RunAtLoad</key>
- <true/>
- <key>UserName</key>
- <string>#{`whoami`.chomp}</string>
- <key>WorkingDirectory</key>
- <string>#{HOMEBREW_PREFIX}/var</string>
-</dict>
-</plist>
+ def startup_plist; <<-EOPLIST.undent
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+ <plist version="1.0">
+ <dict>
+ <key>KeepAlive</key>
+ <true/>
+ <key>Label</key>
+ <string>com.mysql.mysqld</string>
+ <key>Program</key>
+ <string>#{bin}/mysqld_safe</string>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>UserName</key>
+ <string>#{`whoami`.chomp}</string>
+ <key>WorkingDirectory</key>
+ <string>#{HOMEBREW_PREFIX}/var</string>
+ </dict>
+ </plist>
EOPLIST
end
end
diff --git a/Library/Formula/ruby-enterprise-edition.rb b/Library/Formula/ruby-enterprise-edition.rb
index cdc6696a0..fe2671a8e 100644
--- a/Library/Formula/ruby-enterprise-edition.rb
+++ b/Library/Formula/ruby-enterprise-edition.rb
@@ -16,18 +16,18 @@ class RubyEnterpriseEdition <Formula
system *args
end
- def caveats; <<-EOS
-By default we don't compile REE as a shared library. From their documentation:
+ def caveats; <<-EOS.undent
+ By default we don't compile REE as a shared library. From their documentation:
- Please note that enabling --enable-shared will make the Ruby interpreter
- about 20% slower.
+ Please note that enabling --enable-shared will make the Ruby interpreter
+ about 20% slower.
-For desktop environments (particularly ones requiring RubyCocoa) this is
-acceptable and even desirable.
+ For desktop environments (particularly ones requiring RubyCocoa) this is
+ acceptable and even desirable.
-If you need REE to be compiled as a shared library, you can re-compile like so:
+ If you need REE to be compiled as a shared library, you can re-compile like so:
- brew install ruby-enterprise-edition --force --enable-shared
+ brew install ruby-enterprise-edition --force --enable-shared
EOS
end
end
diff --git a/Library/Formula/sip.rb b/Library/Formula/sip.rb
index 92954e07f..6639decde 100644
--- a/Library/Formula/sip.rb
+++ b/Library/Formula/sip.rb
@@ -15,14 +15,13 @@ class Sip <Formula
system "make install"
end
- def caveats; <<-EOS
-This formula won't function until you add the following to your PYTHONPATH
-environment variable:
+ def caveats; <<-EOS.undent
+ This formula won't function until you amend your PYTHONPATH like so:
-#{HOMEBREW_PREFIX}/lib/python
+ export PYTHON_PATH=#{HOMEBREW_PREFIX}/lib/python:$PYTHON_PATH
-This is why you would ideally install sip using pip or easy_install. But this
-can't work because this package doesn't support Python's disttools.
+ This is why you would ideally install sip using pip or easy_install. But this
+ can't work because this package doesn't support Python's disttools.
EOS
end
end
diff --git a/Library/Formula/thrift.rb b/Library/Formula/thrift.rb
index 9d3b636ea..4820f44c1 100644
--- a/Library/Formula/thrift.rb
+++ b/Library/Formula/thrift.rb
@@ -23,10 +23,10 @@ class Thrift <Formula
system "make install"
end
- def caveats; <<-EOS
-We didn't install the python bindings, to do that:
+ def caveats; <<-EOS.undent
+ We didn't install the python bindings, to do that:
- easy_install thrift
+ easy_install thrift
EOS
end
end
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index 34278e6e1..b43979fae 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -61,36 +61,35 @@ module HomebrewArgvExtension
return false
end
- def usage
- <<-EOS
-Usage: brew command [formula] ...
-Usage: brew [--prefix] [--cache] [--version|-v]
-Usage: brew [--verbose|-v]
+ def usage; <<-EOS.undent
+ Usage: brew command [formula] ...
+ Usage: brew [--prefix] [--cache] [--version|-v]
+ Usage: brew [--verbose|-v]
-Principle Commands:
- install formula ... [--ignore-dependencies] [--HEAD|-H]
- list [--unbrewed] [formula] ...
- search [/regex/] [substring]
- uninstall formula ...
- update
+ Principle Commands:
+ install formula ... [--ignore-dependencies] [--HEAD|-H]
+ list [--unbrewed] [formula] ...
+ search [/regex/] [substring]
+ uninstall formula ...
+ update
-Other Commands:
- cleanup [formula]
- home formula ...
- info [formula] [--github]
- link formula ...
- outdated
- prune
- unlink formula ...
+ Other Commands:
+ cleanup [formula]
+ home formula ...
+ info [formula] [--github]
+ link formula ...
+ outdated
+ prune
+ unlink formula ...
-Commands useful when contributing:
- create URL
- edit [formula]
- log formula
- install formula [--debug|-d] [--interactive|-i] [--verbose|-v]
+ Commands useful when contributing:
+ create URL
+ edit [formula]
+ log formula
+ install formula [--debug|-d] [--interactive|-i] [--verbose|-v]
-To visit the Homebrew homepage type:
- brew home
+ To visit the Homebrew homepage type:
+ brew home
EOS
end
diff --git a/Library/Homebrew/extend/string.rb b/Library/Homebrew/extend/string.rb
new file mode 100644
index 000000000..974906b1d
--- /dev/null
+++ b/Library/Homebrew/extend/string.rb
@@ -0,0 +1,15 @@
+class String
+ def undent
+ gsub /^.{#{slice(/^ +/).length}}/, ''
+ end
+end
+
+if __FILE__ == $0
+ undented = <<-EOS.undent
+ hi
+....my friend over
+ there
+ EOS
+
+ assert undented == "hi\nmy friend over\nthere\n"
+end
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 4451e3974..a71ecc67d 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -1,5 +1,6 @@
require 'extend/pathname'
require 'extend/ARGV'
+require 'extend/string'
require 'utils'
ARGV.extend(HomebrewArgvExtension)