Class: MGit::FetchCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/mgit/commands/fetch.rb

Instance Method Summary collapse

Methods inherited from Command

execute, instance_each, list, register_alias, register_command

Methods included from Output

#perror, #pinfo, #ptable, #pwarn

Instance Method Details

#arityObject



12
13
14
# File 'lib/mgit/commands/fetch.rb', line 12

def arity
  [nil, 0]
end

#descriptionObject



20
21
22
# File 'lib/mgit/commands/fetch.rb', line 20

def description
  'fetch all remote repositories'
end

#execute(args) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/mgit/commands/fetch.rb', line 3

def execute(args)
  Registry.chdir_each do |repo|
    `git remote`.split.each do |remote|
      pinfo "Fetching #{remote} in repository #{repo.name}..."
      `git fetch #{remote}`
    end
  end
end

#usageObject



16
17
18
# File 'lib/mgit/commands/fetch.rb', line 16

def usage
  'fetch'
end