Class: Hbc::CLI::Version

Inherits:
AbstractCommand show all
Defined in:
Library/Homebrew/cask/lib/hbc/cli/--version.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractCommand

abstract?, needs_init?, run, visible

Methods included from Options

included, #process_arguments

Constructor Details

#initializeVersion

Returns a new instance of Version

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'Library/Homebrew/cask/lib/hbc/cli/--version.rb', line 8

def initialize(*)
  super
  return if args.empty?
  raise ArgumentError, "#{self.class.command_name} does not take arguments."
end

Class Method Details

.command_nameObject



4
5
6
# File 'Library/Homebrew/cask/lib/hbc/cli/--version.rb', line 4

def self.command_name
  "--#{super}"
end

.helpObject



18
19
20
# File 'Library/Homebrew/cask/lib/hbc/cli/--version.rb', line 18

def self.help
  "displays the Homebrew-Cask version"
end

Instance Method Details

#runObject



14
15
16
# File 'Library/Homebrew/cask/lib/hbc/cli/--version.rb', line 14

def run
  puts Hbc.full_version
end