diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 12d578df81..f279630487 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -133,7 +133,7 @@ module Cask end, "caveats" => caveats, "depends_on" => depends_on, - "conflicts_with" => conflicts_with.to_a, + "conflicts_with" => conflicts_with.to_h, "container" => container, "auto_updates" => auto_updates, } diff --git a/Library/Homebrew/cask/dsl/conflicts_with.rb b/Library/Homebrew/cask/dsl/conflicts_with.rb index fa05f584c1..e9db95fd27 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -25,6 +25,10 @@ module Cask instance_variable_set("@#{key}", instance_variable_get("@#{key}").merge([*value])) end end + + def to_h + Hash[VALID_KEYS.map { |key| [key, instance_variable_get("@#{key}").to_a] }] + end end end end