Class: MGit::RemoveAllCommand

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

Instance Method Summary collapse

Methods inherited from Command

#check_arity, execute, instance_each, list, load_commands, register_alias, register_command

Methods included from Output

#perror, #pinfo, #ptable, #pwarn

Instance Method Details

#arityObject



9
10
11
# File 'lib/mgit/commands/remove_all.rb', line 9

def arity
  [0, 0]
end

#descriptionObject



17
18
19
# File 'lib/mgit/commands/remove_all.rb', line 17

def description
  'removes all repositories from mgit (resets mgit\'s store)'
end

#execute(args) ⇒ Object



3
4
5
6
7
# File 'lib/mgit/commands/remove_all.rb', line 3

def execute(args)
  if agree('This will delete all repositories from mgit. Are you sure?'.red)
    Registry.clean
  end
end

#usageObject



13
14
15
# File 'lib/mgit/commands/remove_all.rb', line 13

def usage
  'removeall'
end