Class: Gem::Commands::CurrentVersionCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/current_version_command.rb

Overview

#

A component of current_gem. #

#

Copyright © 2009-2012 University of Cologne, #

Albertus-Magnus-Platz,                              #
50923 Cologne, Germany                              #
                                                    #

Copyright © 2013 Jens Wille #

#

Authors: #

Jens Wille <[email protected]>                                       #
                                                                        #

current_gem is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation; either version 3 of the License, or (at your # option) any later version. #

#

current_gem is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License # for more details. #

#

You should have received a copy of the GNU Affero General Public License # along with current_gem. If not, see <www.gnu.org/licenses/>. #

#

++

Instance Method Summary collapse

Constructor Details

#initializeCurrentVersionCommand

Returns a new instance of CurrentVersionCommand.



33
34
35
# File 'lib/rubygems/commands/current_version_command.rb', line 33

def initialize
  super 'current_version', "Display a gem's current version"
end

Instance Method Details

#argumentsObject



37
38
39
# File 'lib/rubygems/commands/current_version_command.rb', line 37

def arguments
  'GEMNAME       name of gem to display'
end

#executeObject



45
46
47
48
# File 'lib/rubygems/commands/current_version_command.rb', line 45

def execute
  version = CurrentGem.version_for(get_one_gem_name)
  say version if version
end

#usageObject



41
42
43
# File 'lib/rubygems/commands/current_version_command.rb', line 41

def usage
  "#{program_name} GEMNAME"
end