Module: Rubbr::Scm

Defined in:
lib/rubbr/scm.rb,
lib/rubbr/scm/git.rb,
lib/rubbr/scm/mercurial.rb,
lib/rubbr/scm/subversion.rb

Overview

Extracts changeset stats from various SCM systems. This info can be included in the title page of the latex document and is especially helpful when working with draft versions.

Defined Under Namespace

Classes: Base, Git, Mercurial, Subversion

Class Method Summary collapse

Class Method Details

.stats(dir) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/rubbr/scm.rb', line 26

def self.stats(dir)
  {
    '.svn' => Rubbr::Scm::Subversion,
    '.hg'  => Rubbr::Scm::Mercurial,
    '.git' => Rubbr::Scm::Git
  }.each do |ext, klass|
    if File.exists? File.join(dir, ext)
      return klass.new.collect_scm_stats
    end
  end

  nil
end