Class: Branchtree::Situation

Inherits:
Object
  • Object
show all
Includes:
Context
Defined in:
lib/branchtree/situation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Context

logger

Constructor Details

#initializeSituation

Returns a new instance of Situation.



8
9
10
# File 'lib/branchtree/situation.rb', line 8

def initialize
  @current_branch_name = nil
end

Instance Attribute Details

#current_branch_nameObject (readonly)

Returns the value of attribute current_branch_name.



6
7
8
# File 'lib/branchtree/situation.rb', line 6

def current_branch_name
  @current_branch_name
end

Instance Method Details

#readObject



12
13
14
15
16
# File 'lib/branchtree/situation.rb', line 12

def read
  @current_branch_name = cmd.run(
    "git", "rev-parse", "--abbrev-ref", "HEAD"
  ).out.chomp
end