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 75242b9490..e9db95fd27 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -26,10 +26,8 @@ module Cask end end - def to_a - conflicts={} - @pairs.each { |k, v| conflicts[k]=v } - conflicts + def to_h + Hash[VALID_KEYS.map { |key| [key, instance_variable_get("@#{key}").to_a] }] end end end