github.com/discordapp/buildkite-agent@v2.6.6+incompatible/scripts/utils/update-homebrew-formula.rb (about) 1 #!/usr/bin/env ruby 2 3 # Reads the formula from STDIN and prints an updated version 4 5 # The formula has these sections, which need to be updated: 6 # 7 # stable do 8 # version "..." 9 # url "..." 10 # sha256 "..." 11 # end 12 # 13 # devel do 14 # version "..." 15 # url "..." 16 # sha256 "..." 17 # end 18 19 release, version, url, sha256 = ARGV 20 21 print $stdin.read.sub(%r{ 22 ( 23 #{release} \s+ do .*? 24 version \s+ ").*?(" .*? 25 url \s+ ").*?(" .*? 26 sha256 \s+ ").*?(" .*? 27 end 28 ) 29 }xm, "\\1#{version}\\2#{url}\\3#{sha256}\\4")