Module: Git
- Defined in:
- lib/canuby/git.rb
Overview
Git related methods “WARNING“ Do not include it as clone conflicts with ruby's inbuilt clone.
Class Method Summary collapse
-
.clone(project, quiet = false) ⇒ Object
Clone a projects repository.
-
.pull(project, quiet = false) ⇒ Object
Pull updates for a projects repository.
Class Method Details
.clone(project, quiet = false) ⇒ Object
Clone a projects repository
25 26 27 28 |
# File 'lib/canuby/git.rb', line 25 def self.clone(project, quiet = false) logger.info("Cloning #{const_get(project).url}... to #{const_get(project).path.downcase}") unless quiet system("git clone --depth 1 #{const_get(project).url} #{const_get(project).path.downcase} #{'-q' if quiet}") end |
.pull(project, quiet = false) ⇒ Object
Pull updates for a projects repository
31 32 33 34 35 |
# File 'lib/canuby/git.rb', line 31 def self.pull(project, quiet = false) Dir.chdir(const_get(project).path) do system("git pull #{'-q' if quiet}") end end |