homebrew-cask-versions/lib/cask/cli/edit.rb
Roland Walker 707db75505 standardize Cask (capitalized) when used as noun
* was already done, but inconsistently
* this style follows homebrew Formula
* covers user-facing messages, test titles, comments
* some related minor orthography is included, such
  as the consistent spelling of our project name as
  "homebrew-cask"
* grammar nits
2014-10-08 10:39:51 -04:00

18 lines
588 B
Ruby

class Cask::CLI::Edit < Cask::CLI::Base
def self.run(*args)
cask_names = cask_names_from(args)
raise CaskUnspecifiedError if cask_names.empty?
# only respects the first argument
cask_name = cask_names.first.sub(/\.rb$/i, '')
cask_path = Cask.path(cask_name)
odebug "Opening editor for Cask #{cask_name}"
unless cask_path.exist?
raise CaskUnavailableError, %Q{#{cask_name}, run "brew cask create #{cask_name}" to create a new Cask with this name}
end
exec_editor cask_path
end
def self.help
"edits the Cask of the given name"
end
end