Class: Util
- Inherits:
-
Object
- Object
- Util
- Defined in:
- lib/push2heroku/util.rb
Class Method Summary collapse
- .hard_push?(base) ⇒ Boolean
- .new_install?(base) ⇒ Boolean
- .remote_branch_exists?(remote_branch_name) ⇒ Boolean
Class Method Details
.hard_push?(base) ⇒ Boolean
3 4 5 6 7 8 9 |
# File 'lib/push2heroku/util.rb', line 3 def self.hard_push?(base) remote_branch_name = "h#{base.branch_name}" # do hard push only when expicitly asked # base.hard || !remote_branch_exists?(remote_branch_name) base.hard end |
.new_install?(base) ⇒ Boolean
11 12 13 14 |
# File 'lib/push2heroku/util.rb', line 11 def self.new_install?(base) remote_branch_name = "h#{base.branch_name}" !remote_branch_exists?(remote_branch_name) end |
.remote_branch_exists?(remote_branch_name) ⇒ Boolean
16 17 18 19 |
# File 'lib/push2heroku/util.rb', line 16 def self.remote_branch_exists?(remote_branch_name) out = `cd #{Rails.root.} && git branch -r` out.include?(remote_branch_name) end |