aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/--cache.rb
diff options
context:
space:
mode:
authorMax Nordlund2016-04-03 20:17:01 +0200
committerMartin Afanasjew2016-04-10 22:59:24 +0200
commitb21f699ff2f1691c4f10422c640a9d392cf2d7a7 (Implement the `brew help` command
This is also used by `brew <cmd> --help`. The basic idea is to have the documentation as a top level comment in each command file. To find these comments, they have to be like this `#:`. This is also used by the `brew man` command to keep the documentation DRY, and for that there are now a header and footer for the man page.
Diffstat (limited to 'Library/Homebrew/cmd/--cache.rb')
0 files changed, 0 insertions, 0 deletions
fore, after) if audit_result and sub.nil? opoo "inreplace: replacement of '#{before}' with '#{after}' failed" end return sub end # Looks for Makefile style variable defintions and replaces the # value with "new_value", or removes the definition entirely. def change_make_var! flag, new_value new_value = "#{flag}=#{new_value}" sub = gsub! Regexp.new("^#{flag}[ \\t]*=[ \\t]*(.*)$"), new_value, false opoo "inreplace: changing '#{flag}' to '#{new_value}' failed" if sub.nil? end # Removes variable assignments completely. def remove_make_var! flags # Next line is for Ruby 1.9.x compatibility flags = [flags] unless flags.kind_of? Array flags.each do |flag| # Also remove trailing \n, if present. sub = gsub! Regexp.new("^#{flag}[ \\t]*=(.*)$\n?"), "", false opoo "inreplace: removing '#{flag}' failed" if sub.nil? end end # Finds the specified variable def get_make_var flag m = match Regexp.new("^#{flag}[ \\t]*=[ \\t]*(.*)$") return m[1] if m return nil end end