Class: Branchtree::Situation
- Inherits:
-
Object
- Object
- Branchtree::Situation
- Includes:
- Context
- Defined in:
- lib/branchtree/situation.rb
Instance Attribute Summary collapse
-
#current_branch_name ⇒ Object
readonly
Returns the value of attribute current_branch_name.
Instance Method Summary collapse
-
#initialize ⇒ Situation
constructor
A new instance of Situation.
- #read ⇒ Object
Methods included from Context
Constructor Details
#initialize ⇒ Situation
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_name ⇒ Object (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
#read ⇒ Object
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 |