String.undent for prettier HEREDOCs

This commit is contained in:
Max Howell 2010-02-27 17:26:27 +00:00
parent 41fbc4636b
commit dabeaddebb
6 changed files with 50 additions and 54 deletions

View file

@ -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'

View file

@ -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
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
Please add this line to your .bash_profile:
export ANDROID_SDK_ROOT=#{prefix}
EOS
end
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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