aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2017-10-03 08:31:56 +0200
committerGitHub2017-10-03 08:31:56 +0200
commitec0d8fa7ba18f4fe05c5241258502c8db332b13d (patch)
treec688d2aac67813c920d8420788aa9d19a68552af /Library/Homebrew/cask/lib
parente3226638365713b7f9ea45f8a63322baa7dd1941 (diff)
parent270bf0506a851af4748355791d1875207213466b (diff)
downloadbrew-ec0d8fa7ba18f4fe05c5241258502c8db332b13d.tar.bz2
Merge pull request #3220 from yzguy/yzguy/cask_available_languages_to_info
add available languages to cask info command
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/info.rb8
-rw-r--r--Library/Homebrew/cask/lib/hbc/dsl.rb7
2 files changed, 15 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb
index 9cdada62e..2b4db9530 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/info.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb
@@ -23,6 +23,7 @@ module Hbc
installation_info(cask)
repo_info(cask)
name_info(cask)
+ language_info(cask)
artifact_info(cask)
Installer.print_caveats(cask)
end
@@ -51,6 +52,13 @@ module Hbc
puts cask.name.empty? ? Formatter.error("None") : cask.name
end
+ def self.language_info(cask)
+ return if cask.languages.empty?
+
+ ohai "Languages"
+ puts cask.languages.join(", ")
+ end
+
def self.repo_info(cask)
user, repo, token = QualifiedToken.parse(Hbc.all_tokens.detect { |t| t.split("/").last == cask.token })
diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb
index 1d048bffd..8d5b6c9a9 100644
--- a/Library/Homebrew/cask/lib/hbc/dsl.rb
+++ b/Library/Homebrew/cask/lib/hbc/dsl.rb
@@ -63,6 +63,7 @@ module Hbc
:gpg,
:homepage,
:language,
+ :languages,
:name,
:sha256,
:staged_path,
@@ -145,6 +146,12 @@ module Hbc
@language = @language_blocks.default.call
end
+ def languages
+ return [] if @language_blocks.nil?
+
+ @language_blocks.keys.flatten
+ end
+
def url(*args, &block)
set_unique_stanza(:url, args.empty? && !block_given?) do
begin