factor/extra/contributors/contributors.factor

31 lines
827 B
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2008-05-07 06:14:25 -04:00
USING: io.files io.launcher io.styles io.encodings.ascii io
hashtables kernel sequences sequences.lib assocs system sorting
math.parser sets ;
2007-09-20 18:09:08 -04:00
IN: contributors
2007-10-08 22:28:22 -04:00
: changelog ( -- authors )
2008-04-04 10:17:33 -04:00
image parent-directory [
2008-05-07 06:14:25 -04:00
"git-log --pretty=format:%an" ascii <process-reader> lines
2008-04-04 10:17:33 -04:00
] with-directory ;
2007-09-20 18:09:08 -04:00
: patch-counts ( authors -- assoc )
2007-10-08 22:28:22 -04:00
dup prune
2008-01-09 17:36:30 -05:00
[ dup rot [ = ] with count ] with
2007-10-08 22:28:22 -04:00
{ } map>assoc ;
2007-09-20 18:09:08 -04:00
: contributors ( -- )
2007-10-08 22:28:22 -04:00
changelog patch-counts sort-values <reversed>
2007-09-20 18:09:08 -04:00
standard-table-style [
[
[
2007-10-08 22:28:22 -04:00
first2 swap
2007-09-20 18:09:08 -04:00
[ write ] with-cell
[ number>string write ] with-cell
] with-row
] each
] tabular-output ;
MAIN: contributors