diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 4196ed290e915..ff28c685ca61b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -4179,7 +4179,7 @@ def test(&block) end # {Livecheck} can be used to check for newer versions of the software. - # This method evaluates the DSL specified in the livecheck block of the + # This method evaluates the DSL specified in the `livecheck` block of the # {Formula} (if it exists) and sets the instance variables of a {Livecheck} # object accordingly. This is used by `brew livecheck` to check for newer # versions of the software. diff --git a/Library/Homebrew/livecheck.rb b/Library/Homebrew/livecheck.rb index e3a0b5d48db77..e1f1a72d55347 100644 --- a/Library/Homebrew/livecheck.rb +++ b/Library/Homebrew/livecheck.rb @@ -37,7 +37,7 @@ def initialize(package_or_resource) # Sets the `@referenced_cask_name` instance variable to the provided `String` # or returns the `@referenced_cask_name` instance variable when no argument # is provided. Inherited livecheck values from the referenced cask - # (e.g. regex) can be overridden in the livecheck block. + # (e.g. regex) can be overridden in the `livecheck` block. sig { params( # Name of cask to inherit livecheck info from. @@ -56,7 +56,7 @@ def cask(cask_name = T.unsafe(nil)) # Sets the `@referenced_formula_name` instance variable to the provided # `String` or returns the `@referenced_formula_name` instance variable when # no argument is provided. Inherited livecheck values from the referenced - # formula (e.g. regex) can be overridden in the livecheck block. + # formula (e.g. regex) can be overridden in the `livecheck` block. sig { params( # Name of formula to inherit livecheck info from. diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 3aa03953379f2..42158cd324674 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -79,7 +79,7 @@ def self.resolve_livecheck_reference( full_name: false, debug: false ) - # Check the livecheck block for a formula or cask reference + # Check the `livecheck` block for a formula or cask reference livecheck = formula_or_cask.livecheck livecheck_formula = livecheck.formula livecheck_cask = livecheck.cask diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 636cd0705b1a6..df691aac827ba 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -142,7 +142,7 @@ def fetch(verify_download_integrity: true, timeout: nil, quiet: false) end # {Livecheck} can be used to check for newer versions of the software. - # This method evaluates the DSL specified in the livecheck block of the + # This method evaluates the DSL specified in the `livecheck` block of the # {Resource} (if it exists) and sets the instance variables of a {Livecheck} # object accordingly. This is used by `brew livecheck` to check for newer # versions of the software. diff --git a/Library/Homebrew/rubocops/cask/no_overrides.rb b/Library/Homebrew/rubocops/cask/no_overrides.rb index e1bdb5e77cc8c..294091927e835 100644 --- a/Library/Homebrew/rubocops/cask/no_overrides.rb +++ b/Library/Homebrew/rubocops/cask/no_overrides.rb @@ -40,7 +40,8 @@ def on_system_stanzas(on_system) method_nodes.select(&:block_type?).each do |node| node.child_nodes.each do |child| child.each_node(:send) do |send_node| - # Skip (nested) livecheck blocks as its `url` is different to a download `url`. + # Skip (nested) `livecheck` block as its `url` is different + # from a download `url`. next if send_node.method_name == :livecheck || inside_livecheck_defined?(send_node) # Skip string interpolations. if send_node.ancestors.drop_while { |a| !a.begin_type? }.any? { |a| a.dstr_type? || a.regexp_type? } diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index 800d1fa51d48a..43a7c6be40506 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -508,13 +508,13 @@ def tmp_cask(name, text) let(:online) { true } let(:message) { /Version '[^']*' differs from '[^']*' retrieved by livecheck\./ } - context "when the Cask has a livecheck block using skip" do + context "when the Cask has a `livecheck` block using skip" do let(:cask_token) { "livecheck-skip" } it { is_expected.not_to error_with(message) } end - context "when the Cask has a livecheck block referencing a Cask using skip" do + context "when the Cask has a `livecheck` block referencing a Cask using skip" do let(:cask_token) { "livecheck-skip-reference" } it { is_expected.not_to error_with(message) } @@ -526,7 +526,7 @@ def tmp_cask(name, text) it { is_expected.not_to error_with(message) } end - context "when the Cask has a livecheck block referencing a deprecated Cask" do + context "when the Cask has a `livecheck` block referencing a deprecated Cask" do let(:cask_token) { "livecheck-deprecated-reference" } it { is_expected.not_to error_with(message) } @@ -538,7 +538,7 @@ def tmp_cask(name, text) it { is_expected.not_to error_with(message) } end - context "when the Cask has a livecheck block referencing a disabled Cask" do + context "when the Cask has a `livecheck` block referencing a disabled Cask" do let(:cask_token) { "livecheck-disabled-reference" } it { is_expected.not_to error_with(message) } @@ -550,7 +550,7 @@ def tmp_cask(name, text) it { is_expected.not_to error_with(message) } end - context "when the Cask has a livecheck block referencing a Cask where version is :latest" do + context "when the Cask has a `livecheck` block referencing a Cask where version is :latest" do let(:cask_token) { "livecheck-version-latest-reference" } it { is_expected.not_to error_with(message) } @@ -562,7 +562,7 @@ def tmp_cask(name, text) it { is_expected.not_to error_with(message) } end - context "when the Cask has a livecheck block referencing a Cask with an unversioned url" do + context "when the Cask has a `livecheck` block referencing a Cask with an unversioned url" do let(:cask_token) { "livecheck-url-unversioned-reference" } it { is_expected.not_to error_with(message) } diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index 69529c1e8d4d1..819bb0065b103 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -705,7 +705,7 @@ def post_install end describe "#livecheck_defined?" do - specify "no livecheck block defined" do + specify "no `livecheck` block defined" do f = formula do url "https://brew.sh/test-1.0.tbz" end @@ -713,7 +713,7 @@ def post_install expect(f.livecheck_defined?).to be false end - specify "livecheck block defined" do + specify "`livecheck` block defined" do f = formula do url "https://brew.sh/test-1.0.tbz" livecheck do diff --git a/Library/Homebrew/test/livecheck/livecheck_spec.rb b/Library/Homebrew/test/livecheck/livecheck_spec.rb index c91caebb693eb..c7ba95dac82c4 100644 --- a/Library/Homebrew/test/livecheck/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck/livecheck_spec.rb @@ -77,7 +77,7 @@ end describe "::resolve_livecheck_reference" do - context "when a formula/cask has a livecheck block without formula/cask methods" do + context "when a formula/cask has a `livecheck` block without formula/cask methods" do it "returns [nil, []]" do expect(livecheck.resolve_livecheck_reference(f)).to eq([nil, []]) expect(livecheck.resolve_livecheck_reference(c)).to eq([nil, []]) diff --git a/Library/Homebrew/test/resource_spec.rb b/Library/Homebrew/test/resource_spec.rb index 699772053954e..3ae646ce89fc2 100644 --- a/Library/Homebrew/test/resource_spec.rb +++ b/Library/Homebrew/test/resource_spec.rb @@ -65,18 +65,18 @@ end describe "#livecheck" do - specify "when livecheck block is set" do + specify "when `livecheck` block is set" do expect(livecheck_resource.livecheck.url).to eq("https://brew.sh/test/releases") expect(livecheck_resource.livecheck.regex).to eq(/foo[._-]v?(\d+(?:\.\d+)+)\.t/i) end end describe "#livecheck_defined?" do - it "returns false if livecheck block is not set in resource" do + it "returns false if `livecheck` block is not set in resource" do expect(resource.livecheck_defined?).to be false end - specify "livecheck block defined in resources" do + specify "`livecheck` block defined in resources" do expect(livecheck_resource.livecheck_defined?).to be true end end diff --git a/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb b/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb index ec515a9c4d0a9..42e76de5f1e35 100644 --- a/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/regex_parentheses_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckRegexParentheses do subject(:cop) { described_class.new } - it "reports an offense when the `regex` call in the livecheck block does not use parentheses" do + it "reports an offense when the `regex` call in the `livecheck` block does not use parentheses" do expect_offense(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -30,7 +30,7 @@ class Foo < Formula RUBY end - it "reports no offenses when the `regex` call in the livecheck block uses parentheses" do + it "reports no offenses when the `regex` call in the `livecheck` block uses parentheses" do expect_no_offenses(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" diff --git a/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb b/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb index d802a008ebe63..0afc224aec06b 100644 --- a/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/skip_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckSkip do subject(:cop) { described_class.new } - it "reports an offense when a skipped formula's livecheck block contains other information" do + it "reports an offense when a skipped formula's `livecheck` block contains other information" do expect_offense(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -29,7 +29,7 @@ class Foo < Formula RUBY end - it "reports no offenses when a skipped formula's livecheck block contains no other information" do + it "reports no offenses when a skipped formula's `livecheck` block contains no other information" do expect_no_offenses(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" diff --git a/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb b/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb index 72b41dbb4c41c..cd16f0725e6de 100644 --- a/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/url_provided_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckUrlProvided do subject(:cop) { described_class.new } - it "reports an offense when a `url` is not specified in a livecheck block" do + it "reports an offense when a `url` is not specified in a `livecheck` block" do expect_offense(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -29,7 +29,7 @@ class Foo < Formula RUBY end - it "reports no offenses when a `url` and `regex` are specified in the livecheck block" do + it "reports no offenses when a `url` and `regex` are specified in the `livecheck` block" do expect_no_offenses(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -42,7 +42,7 @@ class Foo < Formula RUBY end - it "reports no offenses when a `url` and `strategy` are specified in the livecheck block" do + it "reports no offenses when a `url` and `strategy` are specified in the `livecheck` block" do expect_no_offenses(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" diff --git a/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb b/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb index 3d46fa5350767..ec6e17d8b296e 100644 --- a/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb +++ b/Library/Homebrew/test/rubocops/livecheck/url_symbol_spec.rb @@ -5,7 +5,7 @@ RSpec.describe RuboCop::Cop::FormulaAudit::LivecheckUrlSymbol do subject(:cop) { described_class.new } - it "reports an offense when the `url` specified in the livecheck block is identical to a formula URL" do + it "reports an offense when the `url` specified in the `livecheck` block is identical to a formula URL" do expect_offense(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz" @@ -28,7 +28,7 @@ class Foo < Formula RUBY end - it "reports no offenses when the `url` specified in the livecheck block is not identical to a formula URL" do + it "reports no offenses when the `url` specified in the `livecheck` block is not identical to a formula URL" do expect_no_offenses(<<~RUBY) class Foo < Formula url "https://brew.sh/foo-1.0.tgz"