Class: Octopolo::Scripts::StaleBranches

Inherits:
Object
  • Object
show all
Includes:
CLIWrapper, ConfigWrapper, GitWrapper
Defined in:
lib/octopolo/scripts/stale_branches.rb

Constant Summary collapse

DEFAULT_BRANCHES =
%W(HEAD master staging production)

Instance Attribute Summary collapse

Attributes included from GitWrapper

#git

Attributes included from ConfigWrapper

#config

Attributes included from CLIWrapper

#cli

Instance Method Summary collapse

Constructor Details

#initialize(delete = false) ⇒ StaleBranches

Returns a new instance of StaleBranches.



16
17
18
# File 'lib/octopolo/scripts/stale_branches.rb', line 16

def initialize(delete=false)
  @delete = delete
end

Instance Attribute Details

#deleteObject Also known as: delete?

Returns the value of attribute delete.



11
12
13
# File 'lib/octopolo/scripts/stale_branches.rb', line 11

def delete
  @delete
end

Instance Method Details

#executeObject



20
21
22
23
24
25
26
# File 'lib/octopolo/scripts/stale_branches.rb', line 20

def execute
  if delete?
    delete_stale_branches
  else
    display_stale_branches
  end
end