2014-09-20 14:38:56 +01:00
|
|
|
module Homebrew
|
|
|
|
def tap_readme
|
|
|
|
name = ARGV.first
|
|
|
|
|
|
|
|
raise "A name is required" if name.nil?
|
|
|
|
|
2014-12-13 23:52:32 +08:00
|
|
|
template = <<-EOS.undent
|
2014-09-20 14:38:56 +01:00
|
|
|
Homebrew-#{name}
|
|
|
|
=========#{'=' * name.size}
|
|
|
|
|
|
|
|
How do I install these formulae?
|
|
|
|
--------------------------------
|
|
|
|
Just `brew tap homebrew/#{name}` and then `brew install <formula>`.
|
|
|
|
|
|
|
|
If the formula conflicts with one from Homebrew/homebrew or another tap, you can `brew install homebrew/#{name}/<formula>`.
|
|
|
|
|
|
|
|
You can also install via URL:
|
|
|
|
|
|
|
|
```
|
|
|
|
brew install https://raw.githubusercontent.com/Homebrew/homebrew-#{name}/master/<formula>.rb
|
|
|
|
```
|
|
|
|
|
|
|
|
Docs
|
|
|
|
----
|
2014-10-26 14:54:36 +00:00
|
|
|
`brew help`, `man brew`, or the Homebrew [docs][].
|
2014-09-20 14:38:56 +01:00
|
|
|
|
2014-10-26 14:54:36 +00:00
|
|
|
[docs]:https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/README.md#readme
|
2014-09-20 14:38:56 +01:00
|
|
|
EOS
|
|
|
|
|
|
|
|
puts template if ARGV.verbose?
|
|
|
|
path = Pathname.new('./README.md')
|
|
|
|
raise "#{path} already exists" if path.exist?
|
|
|
|
path.write template
|
|
|
|
end
|
|
|
|
end
|