Skip to content

Commit

Permalink
Merge pull request #1225 from colindean/gh1223-fix-dump-deprecation-e…
Browse files Browse the repository at this point in the history
…rrors

Use Formula#oldnames to silence deprecation notices
  • Loading branch information
jacobbednarz committed Jul 10, 2023
2 parents c02dfff + d6899ef commit 5264d22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundle/brew_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def formula_to_hash(formula)
{
name: formula.name,
desc: formula.desc,
oldname: formula.oldname,
oldname: formula.oldnames.first,
full_name: formula.full_name,
aliases: formula.aliases,
any_version_installed?: formula.any_version_installed?,
Expand Down
3 changes: 3 additions & 0 deletions spec/bundle/brew_dumper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
name: "foo",
desc: "foobar",
oldname: "oldfoo",
oldnames: ["oldfoo"],
full_name: "qux/quuz/foo",
any_version_installed?: true,
aliases: ["foobar"],
Expand Down Expand Up @@ -58,6 +59,7 @@
name: "bar",
desc: "barfoo",
oldname: nil,
oldnames: [],
full_name: "bar",
any_version_installed?: true,
aliases: [],
Expand Down Expand Up @@ -119,6 +121,7 @@
name: "baz",
desc: "",
oldname: nil,
oldnames: [],
full_name: "bazzles/bizzles/baz",
any_version_installed?: true,
aliases: [],
Expand Down
4 changes: 4 additions & 0 deletions spec/stub/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def oldname
nil
end

def oldnames
[]
end

def aliases
[]
end
Expand Down

0 comments on commit 5264d22

Please sign in to comment.