Class: Repomen::Repo::Handler::Git

Inherits:
Base
  • Object
show all
Defined in:
lib/repomen/repo/handler/git.rb

Overview

TODO:

Uses git’s CLI, since Rugged is not playing nice GitHub Why is that?

Handler for git repositories

Instance Attribute Summary

Attributes inherited from Base

#config, #path, #url

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from WithDefaultConfig

#default_config

Constructor Details

This class inherits a constructor from Repomen::Repo::Handler::Base

Instance Method Details

#discardvoid

This method returns an undefined value.

Removes the repo from the filesystem



13
14
15
# File 'lib/repomen/repo/handler/git.rb', line 13

def discard
  FileUtils.rm_rf(path) if repo_exists?
end

#retrievevoid

This method returns an undefined value.

Retrieves the repo from @url



19
20
21
22
23
24
25
# File 'lib/repomen/repo/handler/git.rb', line 19

def retrieve
  if repo_exists?
    update_repo
  else
    clone_repo
  end
end