aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorMike McQuaid2016-04-22 09:58:40 +0100
committerMike McQuaid2016-04-22 09:58:40 +0100
commit341b64cc962f8ff69a37d7e20f6d94c7d5658ca7 (patch)
treeeba45fec765a1333fe7bc08fab33fec42c0dec76 /share
parent26118d6225ee6d2bb913527191645db04bc10bca (diff)
downloadbrew-341b64cc962f8ff69a37d7e20f6d94c7d5658ca7.tar.bz2
Formula-Cookbook: better `inreplace` example.
Make multiple replacements if using the block form.
Diffstat (limited to 'share')
-rw-r--r--share/doc/homebrew/Formula-Cookbook.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/doc/homebrew/Formula-Cookbook.md b/share/doc/homebrew/Formula-Cookbook.md
index 8aa29bbf1..ab51d431e 100644
--- a/share/doc/homebrew/Formula-Cookbook.md
+++ b/share/doc/homebrew/Formula-Cookbook.md
@@ -373,11 +373,12 @@ A convenience function that can edit files in-place. For example:
`inreplace "path", before, after`
-`before` and `after` can be strings or regular expressions. You can also use the block form:
+`before` and `after` can be strings or regular expressions. You should use the block form if you need to make multiple replacements in a file:
```ruby
inreplace "path" do |s|
s.gsub! /foo/, "bar"
+ s.gsub! "123", "456"
end
```