Class: BuPr::Git
- Inherits:
-
Object
- Object
- BuPr::Git
- Defined in:
- lib/bu_pr/git.rb
Constant Summary collapse
- LOCKFILE =
"Gemfile.lock"
Instance Method Summary collapse
Instance Method Details
#current_branch ⇒ String
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bu_pr/git.rb', line 8 def current_branch @current_branch ||= begin branches.each_line do |line| matched = line.strip.match(/\*\s+(?<current_branch>.+)/) next unless matched break matched["current_branch"] end end end |
#diff? ⇒ Boolean
21 22 23 |
# File 'lib/bu_pr/git.rb', line 21 def diff? `git status`.include? LOCKFILE end |
#installed? ⇒ Boolean
26 27 28 |
# File 'lib/bu_pr/git.rb', line 26 def installed? system "git --help > /dev/null 2>&1" end |
#push ⇒ Object
30 31 32 |
# File 'lib/bu_pr/git.rb', line 30 def push add && commit && _push end |