0.0
No commit activity in last 3 years
No release in over 3 years
The contributors gem is useful for getting informations about project contributors. It assumes that Git is used. In particular it can be used for generating CONTRIBUTORS file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

About

The contributors gem is useful for getting informations about project contributors. It assumes that Git is used. In particular it can be used for generating CONTRIBUTORS file.

Usage

Just install it through RubyGems:

gem install contributors

Use the API:

require "contributors"

contributors = Contributors.new
contributors.results
# => {#<Grit::Actor "Jakub Stastny aka botanicus <stastny@101ideas.cz>"> => {:commits => 9, :LOC => 255}}

# You can optionally specify project path thusly:
contributors = Contributors.new(Dir.pwd)

# The Contributors#result method takes an optional argument
# determining by which field you want to sort the results:
contributors.results(:LOC) # or :commits

# By default it takes all the changes (as the second argument
# defaults to :total), but if you want, you can limit changes
# on :additions or :deletions only:
contributors.results(:LOC, :additions)

Use the Nake tasks:

load "contributors.nake"

# OPTIONAL: Where the project is located. Defaults to Dir.pwd.
Task[:contributors].config[:path] = Dir.pwd

# OPTIONAL: Where the CONTRIBUTORS file is located.
# It can be either a string or a callable object. Defaults to:
# Proc.new { File.join(task.config[:path], "CONTRIBUTORS") }
Task[:contributors].config[:output_path] = Proc.new { File.join(task.config[:path], "CONTRIBUTORS") }

# OPTIONAL: How to sort results, options are :commits or :LOC, :LOC is default.
Task[:contributors].config[:sort_by] = :LOC

# OPTIONAL: Criterium for counting lines of code. Can be either
# :additions, :deletions or :total (which is the default value).
Task[:contributors].config[:criterium] = :total

# OPTIONAL: How to format each line. E-mail is author's e-mail and in data
there are keys :name, :commits and :LOC. Commits and LOC are both integers.
Task[:contributors].config[:format] = -> { |author, data| "#{author.email}: #{data[:LOC]}" }