Class: Gem::Commands::CloneCommand

Inherits:
Gem::Command
  • Object
show all
Includes:
GemGit::Helper
Defined in:
lib/rubygems/commands/clone_command.rb

Instance Method Summary collapse

Methods included from GemGit::Helper

#git, #github_clone_url, #github_info_for, #github_token, #github_user, #repository_url_for

Constructor Details

#initializeCloneCommand

Returns a new instance of CloneCommand.



4
5
6
# File 'lib/rubygems/commands/clone_command.rb', line 4

def initialize
  super 'clone', "Clone a gem's source from its repository."
end

Instance Method Details

#descriptionObject

:nodoc:



8
9
10
# File 'lib/rubygems/commands/clone_command.rb', line 8

def description # :nodoc:
  "Clone a gem's source from its repository."
end

#executeObject



12
13
14
15
16
17
18
19
20
# File 'lib/rubygems/commands/clone_command.rb', line 12

def execute
  gem_name = get_one_optional_argument
  
  url = repository_url_for(gem_name)
  puts "Cloning #{gem_name} from #{url}..."
  
  git "clone", url
  super
end