2020-06-30 09:57:34 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "formula"
|
|
|
|
|
|
|
|
module Versions
|
|
|
|
def current_formula_version(formula_name)
|
|
|
|
Formula[formula_name].version.to_s.to_f
|
|
|
|
end
|
|
|
|
|
|
|
|
def bump_formula_pr(formula_name, url)
|
2020-07-01 11:44:56 -05:00
|
|
|
Utils.popen_read("brew", "bump-formula-pr", "--no-browse", "--dry-run",
|
|
|
|
formula_name, "--url=#{url}").chomp
|
2020-06-30 09:57:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def check_for_open_pr(formula_name, download_url)
|
2020-06-30 10:23:18 -05:00
|
|
|
ohai "- Checking for open PRs for formula : #{formula_name}"
|
2020-06-30 09:57:34 -05:00
|
|
|
|
|
|
|
response = bump_formula_pr(formula_name, download_url)
|
2020-06-30 10:23:18 -05:00
|
|
|
!response.include? "Error: These open pull requests may be duplicates"
|
2020-06-30 09:57:34 -05:00
|
|
|
end
|
|
|
|
end
|