homebrew-cask-versions/lib/cask/cli/cat.rb
Roland Walker 4f82dda065 Merge pull request #4242 from rolandwalker/cat_documentation
update docs and messages for `brew cask cat`
2014-05-07 22:34:07 -04:00

14 lines
438 B
Ruby

module Cask::CLI::Cat
def self.run(*arguments)
# only respects the first argument
raise CaskUnspecifiedError if arguments.empty?
cask_name = arguments.first.sub(/\.rb$/i, '')
cask_path = Cask.path(cask_name)
raise CaskUnavailableError, cask_name.to_s unless cask_path.exist?
puts File.open(cask_path) { |f| f.read }
end
def self.help
"dump raw source of the given Cask to the standard output"
end
end