aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat
diff options
context:
space:
mode:
authorMarkus Reiter2016-10-08 13:25:38 +0200
committerMarkus Reiter2016-10-09 15:34:12 +0200
commit67a7d1a64a0d69d60a6cdd17a8296c8cce215b7f (patch)
tree61dff51ef579ff79a5df332fd5eeb644afd46002 /Library/Homebrew/compat
parent0c193c308ecfac9a6c9dba514a9d3991f8c6cecf (diff)
downloadbrew-67a7d1a64a0d69d60a6cdd17a8296c8cce215b7f.tar.bz2
Fix getting cask path for queries.
Diffstat (limited to 'Library/Homebrew/compat')
-rw-r--r--Library/Homebrew/compat/hbc.rb1
-rw-r--r--Library/Homebrew/compat/hbc/cask_loader.rb18
2 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/compat/hbc.rb b/Library/Homebrew/compat/hbc.rb
new file mode 100644
index 000000000..a1d1414a5
--- /dev/null
+++ b/Library/Homebrew/compat/hbc.rb
@@ -0,0 +1 @@
+require "compat/hbc/cask_loader"
diff --git a/Library/Homebrew/compat/hbc/cask_loader.rb b/Library/Homebrew/compat/hbc/cask_loader.rb
new file mode 100644
index 000000000..e7f3a4aac
--- /dev/null
+++ b/Library/Homebrew/compat/hbc/cask_loader.rb
@@ -0,0 +1,18 @@
+module CaskLoaderCompatibilityLayer
+ private
+
+ def build_cask(header_token, &block)
+ if header_token.is_a?(Hash) && header_token.key?(:v1)
+ odeprecated %q("cask :v1 => 'token'"), %q("cask 'token'")
+ header_token = header_token[:v1]
+ end
+
+ super(header_token, &block)
+ end
+end
+
+module Hbc
+ class CaskLoader
+ prepend CaskLoaderCompatibilityLayer
+ end
+end