Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (53 sloc) 1.505 kb
e75c821 @veganstraightedge moved committers rake tasks out of Rakefile and into rakelib
veganstraightedge authored
1 # shell command for quarterly list of committers
2 def quarterly_committers(start_month, year=Time.now.year)
62d33d6 @veganstraightedge removed misnamed rake committers.rb file
veganstraightedge authored
3 "git log --since='#{start_month}/1/#{year}' --until='#{start_month + 2}/31/#{year}' | git shortlog -n -s -e"
e75c821 @veganstraightedge moved committers rake tasks out of Rakefile and into rakelib
veganstraightedge authored
4 end
5
6 def future?(start_month, year=Time.now.year)
7 require "date"
8
9 if Date.parse("#{start_month}/1/#{year}") > Date.today
10 puts
11 puts "ERROR: That's the future!"
12 puts
13 true
14 elsif year < Time.now.year
15 false
9d28424 @veganstraightedge typo fixed: else to elsif in rake commiters
veganstraightedge authored
16 elsif Date.parse("#{start_month + 2}/28/#{year}") > Date.today
e75c821 @veganstraightedge moved committers rake tasks out of Rakefile and into rakelib
veganstraightedge authored
17 puts
18 puts "WARNING: That's the current quarter."
19 puts
20 end
21 end
22
23 namespace :committers do
24 desc "Prints list of committers from first calendar quarter of this year"
25 task :q1 do
26 unless future?(1)
27 sh quarterly_committers(1)
28 end
29 end
30
31 desc "Prints list of committers from second calendar quarter of this year"
32 task :q2 do
33 unless future?(4)
34 sh quarterly_committers(4)
35 end
36 end
37
38 desc "Prints list of committers from third calendar quarter of this year"
39 task :q3 do
40 unless future?(7)
41 sh quarterly_committers(7)
42 end
43 end
44
45 desc "Prints list of committers from fourth calendar quarter of this year"
46 task :q4 do
47 unless future?(10)
48 sh quarterly_committers(10)
49 end
50 end
51
52 namespace :q4 do
53 desc "Prints list of committers from fourth calendar quarter of LAST year"
54 task :last_year do
55 unless future?(10, Time.now.year - 1)
56 sh quarterly_committers(10, Time.now.year - 1)
57 end
58 end
59 end
60 end
Something went wrong with that request. Please try again.