Class: GitRepo
- Defined in:
- lib/exogenesis/passengers/git_repo.rb
Overview
Clone, Update and Delete Git Repos REQUIRES: git
Instance Method Summary collapse
-
#down ⇒ Object
Delete the Repos.
-
#up ⇒ Object
Clone the Repo if it doesn’t exist Pull the Repo if it does.
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
#down ⇒ Object
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 |
#up ⇒ Object
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 |