Minor fixes
This commit is contained in:
parent
6d993fa642
commit
03c372ef52
@ -33,7 +33,7 @@ module Homebrew
|
|||||||
stable_from_internet_archive = stable_url.match?(%r{https?://web\.archive\.org/}i)
|
stable_from_internet_archive = stable_url.match?(%r{https?://web\.archive\.org/}i)
|
||||||
end
|
end
|
||||||
|
|
||||||
skip_message = if package_or_resource.livecheck&.skip_msg.present?
|
skip_message = if package_or_resource.livecheck.skip_msg.present?
|
||||||
package_or_resource.livecheck.skip_msg
|
package_or_resource.livecheck.skip_msg
|
||||||
elsif !livecheckable
|
elsif !livecheckable
|
||||||
if stable_from_google_code_archive
|
if stable_from_google_code_archive
|
||||||
@ -45,7 +45,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {} if !package_or_resource.livecheck&.skip? && skip_message.blank?
|
return {} if !package_or_resource.livecheck.skip? && skip_message.blank?
|
||||||
|
|
||||||
skip_messages = skip_message ? [skip_message] : nil
|
skip_messages = skip_message ? [skip_message] : nil
|
||||||
Livecheck.status_hash(package_or_resource, "skipped", skip_messages, full_name: full_name, verbose: verbose)
|
Livecheck.status_hash(package_or_resource, "skipped", skip_messages, full_name: full_name, verbose: verbose)
|
||||||
@ -172,7 +172,7 @@ module Homebrew
|
|||||||
:cask_url_unversioned,
|
:cask_url_unversioned,
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
# Skip conditions for resource
|
# Skip conditions for resource.
|
||||||
RESOURCE_CHECKS = [
|
RESOURCE_CHECKS = [
|
||||||
:package_or_resource_skip,
|
:package_or_resource_skip,
|
||||||
].freeze
|
].freeze
|
||||||
|
@ -11,6 +11,7 @@ describe Homebrew::Livecheck do
|
|||||||
let(:homepage_url) { "https://brew.sh" }
|
let(:homepage_url) { "https://brew.sh" }
|
||||||
let(:livecheck_url) { "https://formulae.brew.sh/api/formula/ruby.json" }
|
let(:livecheck_url) { "https://formulae.brew.sh/api/formula/ruby.json" }
|
||||||
let(:stable_url) { "https://brew.sh/test-0.0.1.tgz" }
|
let(:stable_url) { "https://brew.sh/test-0.0.1.tgz" }
|
||||||
|
let(:resource_url) { "https://brew.sh/foo-1.0.tar.gz" }
|
||||||
|
|
||||||
let(:f) do
|
let(:f) do
|
||||||
formula("test") do
|
formula("test") do
|
||||||
@ -116,6 +117,7 @@ describe Homebrew::Livecheck do
|
|||||||
homepage_url_s = homepage_url
|
homepage_url_s = homepage_url
|
||||||
stable_url_s = stable_url
|
stable_url_s = stable_url
|
||||||
head_url_s = head_url
|
head_url_s = head_url
|
||||||
|
resource_url_s = resource_url
|
||||||
|
|
||||||
formula("test_livecheck_url") do
|
formula("test_livecheck_url") do
|
||||||
desc "Test Livecheck URL formula"
|
desc "Test Livecheck URL formula"
|
||||||
@ -124,7 +126,7 @@ describe Homebrew::Livecheck do
|
|||||||
head head_url_s
|
head head_url_s
|
||||||
|
|
||||||
resource "foo" do
|
resource "foo" do
|
||||||
url "https://brew.sh/foo-1.0.tar.gz"
|
url resource_url_s
|
||||||
sha256 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
sha256 "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
||||||
|
|
||||||
livecheck do
|
livecheck do
|
||||||
@ -164,15 +166,7 @@ describe Homebrew::Livecheck do
|
|||||||
expect(livecheck.livecheck_url_to_string(:homepage, c_livecheck_url)).to eq(homepage_url)
|
expect(livecheck.livecheck_url_to_string(:homepage, c_livecheck_url)).to eq(homepage_url)
|
||||||
expect(livecheck.livecheck_url_to_string(:stable, f_livecheck_url)).to eq(stable_url)
|
expect(livecheck.livecheck_url_to_string(:stable, f_livecheck_url)).to eq(stable_url)
|
||||||
expect(livecheck.livecheck_url_to_string(:url, c_livecheck_url)).to eq(cask_url)
|
expect(livecheck.livecheck_url_to_string(:url, c_livecheck_url)).to eq(cask_url)
|
||||||
|
expect(livecheck.livecheck_url_to_string(:url, r_livecheck_url)).to eq(resource_url)
|
||||||
r_livecheck_url.livecheck.url(:url)
|
|
||||||
expect(livecheck.livecheck_url_to_string(cask_url, r_livecheck_url)).to eq(cask_url)
|
|
||||||
|
|
||||||
r_livecheck_url.livecheck.url(:head)
|
|
||||||
expect(livecheck.livecheck_url_to_string(head_url, r_livecheck_url)).to eq(head_url)
|
|
||||||
|
|
||||||
r_livecheck_url.livecheck.url(:stable)
|
|
||||||
expect(livecheck.livecheck_url_to_string(stable_url, r_livecheck_url)).to eq(stable_url)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns nil when not given a string or valid symbol" do
|
it "returns nil when not given a string or valid symbol" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user