Class: DevFlow::Clean

Inherits:
App
  • Object
show all
Defined in:
lib/dev_flow/commands/clean.rb

Instance Attribute Summary

Attributes inherited from App

#command, #config, #git, #logger, #members, #roadmap, #waiting

Instance Method Summary collapse

Methods inherited from App

#all_member_names, #ask_rebase, #debug, #display_close_waiting, #display_tasks, #error, #hello, #hr, #hrb, #hrbh, #hrh, #i_am_leader?, #i_am_moderator?, #i_am_supervisor?, #i_have_power?, #in_release?, #in_trunk?, #info, #initialize, #leader_name, #load_roadmap, #new_version, #switch_to!, #sync?, #task, #tasks_for_close, #upload_progress!, #user_name, #warn

Constructor Details

This class inherits a constructor from DevFlow::App

Instance Method Details

#process!Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dev_flow/commands/clean.rb', line 4

def process!
  completed_branches = Array.new
  @roadmap.tasks.each {|t| completed_branches << t.branch_name if t.is_completed?}
  
  @git.branches.each do |t|
    if completed_branches.include? t
      print "delete completed branch #{t}? [Y/n]:"
      ans = STDIN.gets.chomp!
      unless ans == 'n'
        `git branch -d #{t}`
      end
    end
  end

  info "prune git remote (delete zoombie remote refs)"
  `git remote prune #{@config["git_remote"]}`
end