Class: GitRepo

Inherits:
Passenger show all
Defined in:
lib/exogenesis/passengers/git_repo.rb

Overview

Clone, Update and Delete Git Repos REQUIRES: git

Instance Method Summary collapse

Methods inherited from Passenger

by_name, emoji_name, #initialize, needs, register_as, with_emoji

Constructor Details

This class inherits a constructor from Passenger

Instance Method Details

#downObject

Delete the Repos



23
24
25
26
27
# File 'lib/exogenesis/passengers/git_repo.rb', line 23

def down
  each_repo_and_target do |_, target|
    rm_rf(target)
  end
end

#upObject

Clone the Repo if it doesn’t exist Pull the Repo if it does



12
13
14
15
16
17
18
19
20
# File 'lib/exogenesis/passengers/git_repo.rb', line 12

def up
  each_repo_and_target do |git_repo, target|
    if target.exist?
      pull_repo(git_repo, target)
    else
      clone_repo(git_repo, target)
    end
  end
end