Module: Git

Defined in:
lib/canuby/util.rb

Overview

Git related methods “WARNING“ Do not include it as clone conflicts with ruby’s inbuilt clone.

Class Method Summary collapse

Class Method Details

.clone(project, quiet = false) ⇒ Object

Clone a projects repository



139
140
141
142
# File 'lib/canuby/util.rb', line 139

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



145
146
147
148
149
# File 'lib/canuby/util.rb', line 145

def self.pull(project, quiet = false)
  Dir.chdir(const_get(project).path) do
    system("git pull #{'-q' if quiet}")
  end
end