Class: PGit::CurrentBranch
- Inherits:
-
Object
- Object
- PGit::CurrentBranch
- Defined in:
- lib/pgit/current_branch.rb
Instance Method Summary collapse
-
#initialize ⇒ CurrentBranch
constructor
A new instance of CurrentBranch.
- #name ⇒ Object
- #story_id ⇒ Object
Constructor Details
#initialize ⇒ CurrentBranch
Returns a new instance of CurrentBranch.
3 4 5 6 7 |
# File 'lib/pgit/current_branch.rb', line 3 def initialize @branches = `git branch` raise @branches unless current.any? end |
Instance Method Details
#name ⇒ Object
9 10 11 |
# File 'lib/pgit/current_branch.rb', line 9 def name current.first.gsub(/\*\s*/, '') end |
#story_id ⇒ Object
13 14 15 |
# File 'lib/pgit/current_branch.rb', line 13 def story_id name.scan(/\d+$/).first end |