Class: Borg::Git
- Inherits:
-
Object
- Object
- Borg::Git
- Defined in:
- lib/borg/borg_git.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/borg/borg_git.rb', line 6 def status @status end |
Instance Method Details
#current_branch ⇒ Object
7 8 9 10 11 |
# File 'lib/borg/borg_git.rb', line 7 def current_branch cmd_output = `git symbolic-ref HEAD` branch_name = cmd_output.strip.split("/")[-1] branch_name end |
#update ⇒ Object
13 14 15 16 17 |
# File 'lib/borg/borg_git.rb', line 13 def update FileUtils.cd(Rails.root) do @status = system("git reset --hard HEAD && git fetch && git rebase origin/#{current_branch} && git submodule init && git submodule update") end end |