Class: MacSetup::GitRepoInstaller
- Inherits:
-
Object
- Object
- MacSetup::GitRepoInstaller
- Defined in:
- lib/mac_setup/git_repo_installer.rb
Instance Attribute Summary collapse
-
#install_path ⇒ Object
readonly
Returns the value of attribute install_path.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tracking_key ⇒ Object
readonly
Returns the value of attribute tracking_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(repo, install_path, tracking_key: nil, status: nil) ⇒ GitRepoInstaller
constructor
A new instance of GitRepoInstaller.
- #install_or_update ⇒ Object
Constructor Details
#initialize(repo, install_path, tracking_key: nil, status: nil) ⇒ GitRepoInstaller
Returns a new instance of GitRepoInstaller.
22 23 24 25 26 27 |
# File 'lib/mac_setup/git_repo_installer.rb', line 22 def initialize(repo, install_path, tracking_key: nil, status: nil) @repo = repo @install_path = install_path @tracking_key = tracking_key @status = status end |
Instance Attribute Details
#install_path ⇒ Object (readonly)
Returns the value of attribute install_path.
5 6 7 |
# File 'lib/mac_setup/git_repo_installer.rb', line 5 def install_path @install_path end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
5 6 7 |
# File 'lib/mac_setup/git_repo_installer.rb', line 5 def repo @repo end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/mac_setup/git_repo_installer.rb', line 5 def status @status end |
#tracking_key ⇒ Object (readonly)
Returns the value of attribute tracking_key.
5 6 7 |
# File 'lib/mac_setup/git_repo_installer.rb', line 5 def tracking_key @tracking_key end |
Class Method Details
.install_repo(repo, install_path, track: nil, status: nil) ⇒ Object
18 19 20 |
# File 'lib/mac_setup/git_repo_installer.rb', line 18 def self.install_repo(repo, install_path, track: nil, status: nil) new(repo, install_path, tracking_key: track, status: status).install_or_update end |
.run(config, _status) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mac_setup/git_repo_installer.rb', line 7 def self.run(config, _status) repos = config.git_repos return if repos.none? MacSetup.log "Installing Git Repos..." repos.each do |repo, install_path| new(repo, File.(install_path)).install_or_update end end |