Class: MGit::FetchCommand

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

Instance Method Summary collapse

Methods inherited from Command

create, #help, instance_each, list, register_alias, register_command

Instance Method Details

#descriptionObject



18
19
20
# File 'lib/mgit/commands/fetch.rb', line 18

def description
  'fetch all remote repositories'
end

#execute(args) ⇒ Object



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

def execute(args)
  raise TooManyArgumentsError.new(self) if args.size != 0

  Registry.chdir_each do |repo|
    `git remote`.split.each do |remote|
      puts "Fetching #{remote} in repository #{repo.name}...".yellow
      `git fetch #{remote}`
    end
  end
end

#usageObject



14
15
16
# File 'lib/mgit/commands/fetch.rb', line 14

def usage
  'fetch'
end