git_fame 2.5.2 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/exe/git-fame +9 -0
- data/lib/git_fame/author.rb +5 -75
- data/lib/git_fame/base.rb +10 -523
- data/lib/git_fame/collector.rb +45 -0
- data/lib/git_fame/command.rb +171 -0
- data/lib/git_fame/contribution.rb +12 -0
- data/lib/git_fame/diff.rb +25 -0
- data/lib/git_fame/error.rb +5 -0
- data/lib/git_fame/extension.rb +16 -0
- data/lib/git_fame/filter.rb +43 -0
- data/lib/git_fame/render/extension.rb +26 -0
- data/lib/git_fame/render.rb +38 -0
- data/lib/git_fame/result.rb +29 -4
- data/lib/git_fame/types.rb +11 -0
- data/lib/git_fame/version.rb +3 -1
- data/lib/git_fame.rb +16 -3
- metadata +82 -111
- data/.gitignore +0 -20
- data/.gitmodules +0 -3
- data/.rspec +0 -7
- data/.travis.yml +0 -16
- data/Gemfile +0 -4
- data/LICENSE +0 -22
- data/README.md +0 -140
- data/Rakefile +0 -15
- data/bin/git-fame +0 -58
- data/git_fame.gemspec +0 -42
- data/lib/git_fame/blame_parser.rb +0 -83
- data/lib/git_fame/commit_range.rb +0 -27
- data/lib/git_fame/errors.rb +0 -6
- data/lib/git_fame/file.rb +0 -13
- data/lib/git_fame/helper.rb +0 -11
- data/lib/git_fame/silent_progressbar.rb +0 -20
- data/spec/bin_spec.rb +0 -116
- data/spec/git_fame_spec.rb +0 -488
- data/spec/spec_helper.rb +0 -65
- data/spec/support/startup.rb +0 -21
metadata
CHANGED
@@ -1,249 +1,226 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_fame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '7.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '7.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: dry-initializer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: dry-struct
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: dry-types
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0
|
61
|
+
version: '1.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: neatjson
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: '0.9'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: '0.9'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rugged
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '1.0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '1.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: tty-box
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
type: :
|
103
|
+
version: '0.5'
|
104
|
+
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0.5'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: tty-option
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :
|
117
|
+
version: '0.2'
|
118
|
+
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: '0.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: tty-screen
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
132
|
-
type: :
|
131
|
+
version: '0.5'
|
132
|
+
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '0.5'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: tty-spinner
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
146
|
-
type: :
|
145
|
+
version: '0.9'
|
146
|
+
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: '0.9'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: tty-table
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 1.8.3
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
157
|
+
- - "<="
|
165
158
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: tins
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
159
|
+
version: 0.10.0
|
171
160
|
- - "~>"
|
172
161
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
174
|
-
type: :
|
162
|
+
version: '0.9'
|
163
|
+
type: :runtime
|
175
164
|
prerelease: false
|
176
165
|
version_requirements: !ruby/object:Gem::Requirement
|
177
166
|
requirements:
|
167
|
+
- - "<="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: 0.10.0
|
178
170
|
- - "~>"
|
179
171
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
172
|
+
version: '0.9'
|
181
173
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
174
|
+
name: zeitwerk
|
183
175
|
requirement: !ruby/object:Gem::Requirement
|
184
176
|
requirements:
|
185
177
|
- - "~>"
|
186
178
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
188
|
-
type: :
|
179
|
+
version: '2.0'
|
180
|
+
type: :runtime
|
189
181
|
prerelease: false
|
190
182
|
version_requirements: !ruby/object:Gem::Requirement
|
191
183
|
requirements:
|
192
184
|
- - "~>"
|
193
185
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
205
|
-
requirements:
|
206
|
-
- - ">="
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: '0'
|
209
|
-
description: A command-line tool that helps you summarize and pretty-print collaborators
|
210
|
-
in a git repository based on contributions
|
186
|
+
version: '2.0'
|
187
|
+
description: |
|
188
|
+
A command-line tool that helps you summarize and
|
189
|
+
pretty-print collaborators in a git repository
|
190
|
+
based on contributions
|
191
|
+
|
192
|
+
Generates stats like:
|
193
|
+
- Number of files changed by a user
|
194
|
+
- Number of commits by user
|
195
|
+
- Lines of code by a user'
|
211
196
|
email:
|
212
|
-
-
|
197
|
+
- oleander@users.noreply.github.com
|
213
198
|
executables:
|
214
199
|
- git-fame
|
215
200
|
extensions: []
|
216
201
|
extra_rdoc_files: []
|
217
202
|
files:
|
218
|
-
-
|
219
|
-
- ".gitmodules"
|
220
|
-
- ".rspec"
|
221
|
-
- ".travis.yml"
|
222
|
-
- Gemfile
|
223
|
-
- LICENSE
|
224
|
-
- README.md
|
225
|
-
- Rakefile
|
226
|
-
- bin/git-fame
|
227
|
-
- git_fame.gemspec
|
203
|
+
- exe/git-fame
|
228
204
|
- lib/git_fame.rb
|
229
205
|
- lib/git_fame/author.rb
|
230
206
|
- lib/git_fame/base.rb
|
231
|
-
- lib/git_fame/
|
232
|
-
- lib/git_fame/
|
233
|
-
- lib/git_fame/
|
234
|
-
- lib/git_fame/
|
235
|
-
- lib/git_fame/
|
207
|
+
- lib/git_fame/collector.rb
|
208
|
+
- lib/git_fame/command.rb
|
209
|
+
- lib/git_fame/contribution.rb
|
210
|
+
- lib/git_fame/diff.rb
|
211
|
+
- lib/git_fame/error.rb
|
212
|
+
- lib/git_fame/extension.rb
|
213
|
+
- lib/git_fame/filter.rb
|
214
|
+
- lib/git_fame/render.rb
|
215
|
+
- lib/git_fame/render/extension.rb
|
236
216
|
- lib/git_fame/result.rb
|
237
|
-
- lib/git_fame/
|
217
|
+
- lib/git_fame/types.rb
|
238
218
|
- lib/git_fame/version.rb
|
239
|
-
|
240
|
-
- spec/git_fame_spec.rb
|
241
|
-
- spec/spec_helper.rb
|
242
|
-
- spec/support/startup.rb
|
243
|
-
homepage: http://oleander.io/git-fame-rb
|
219
|
+
homepage: https://github.com/oleander/git-fame-rb
|
244
220
|
licenses: []
|
245
|
-
metadata:
|
246
|
-
|
221
|
+
metadata:
|
222
|
+
rubygems_mfa_required: 'true'
|
223
|
+
post_install_message:
|
247
224
|
rdoc_options: []
|
248
225
|
require_paths:
|
249
226
|
- lib
|
@@ -251,23 +228,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
251
228
|
requirements:
|
252
229
|
- - ">="
|
253
230
|
- !ruby/object:Gem::Version
|
254
|
-
version:
|
231
|
+
version: 2.7.0
|
255
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
256
233
|
requirements:
|
257
234
|
- - ">="
|
258
235
|
- !ruby/object:Gem::Version
|
259
236
|
version: '0'
|
260
237
|
requirements: []
|
261
|
-
|
262
|
-
|
263
|
-
signing_key:
|
238
|
+
rubygems_version: 3.3.3
|
239
|
+
signing_key:
|
264
240
|
specification_version: 4
|
265
|
-
summary:
|
241
|
+
summary: git-fame is a command-line tool that helps you summarize and pretty-print
|
266
242
|
collaborators in a git repository based on contributions. A Ruby wrapper for git-blame
|
267
|
-
if you will.
|
268
|
-
|
269
|
-
test_files:
|
270
|
-
- spec/bin_spec.rb
|
271
|
-
- spec/git_fame_spec.rb
|
272
|
-
- spec/spec_helper.rb
|
273
|
-
- spec/support/startup.rb
|
243
|
+
if you will.
|
244
|
+
test_files: []
|
data/.gitignore
DELETED
data/.gitmodules
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.3.1
|
4
|
-
- 2.2.0
|
5
|
-
- 2.1.0
|
6
|
-
- 2.0.0
|
7
|
-
- 1.9.3
|
8
|
-
script:
|
9
|
-
- bundle exec rspec spec
|
10
|
-
notifications:
|
11
|
-
webhooks:
|
12
|
-
urls:
|
13
|
-
- https://webhooks.gitter.im/e/e2b034ea2dbc919b02f7
|
14
|
-
on_success: change
|
15
|
-
on_failure: change
|
16
|
-
on_start: false
|
data/Gemfile
DELETED
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Linus Oleander
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,140 +0,0 @@
|
|
1
|
-
# git-fame
|
2
|
-
[](https://rubygems.org/gems/git_fame)
|
3
|
-
[](https://gitter.im/oleander/git-fame-rb)
|
4
|
-
[](https://travis-ci.org/oleander/git-fame-rb)
|
5
|
-
[](https://coveralls.io/github/oleander/git-fame-rb)
|
6
|
-
[](http://oleander.io)
|
7
|
-
|
8
|
-
`git-fame` is a command-line tool that helps you summarize and pretty-print collaborators in a git repository based on contributions.
|
9
|
-
|
10
|
-
## Example output
|
11
|
-
|
12
|
-
Statistics generated from this git repository using `git fame .`
|
13
|
-
|
14
|
-
```
|
15
|
-
Statistics based on master
|
16
|
-
Active files: 21
|
17
|
-
Active lines: 967
|
18
|
-
Total commits: 109
|
19
|
-
|
20
|
-
Note: Files matching MIME type image, binary has been ignored
|
21
|
-
|
22
|
-
+----------------+-----+---------+-------+---------------------+
|
23
|
-
| name | loc | commits | files | distribution (%) |
|
24
|
-
+----------------+-----+---------+-------+---------------------+
|
25
|
-
| Linus Oleander | 914 | 106 | 21 | 94.5 / 97.2 / 100.0 |
|
26
|
-
| f1yegor | 47 | 2 | 7 | 4.9 / 1.8 / 33.3 |
|
27
|
-
| David Selassie | 6 | 1 | 2 | 0.6 / 0.9 / 9.5 |
|
28
|
-
+----------------+-----+---------+-------+---------------------+
|
29
|
-
```
|
30
|
-
|
31
|
-
## Installation
|
32
|
-
|
33
|
-
`[sudo] gem install git_fame`
|
34
|
-
|
35
|
-
## Usage
|
36
|
-
|
37
|
-
### Command-line
|
38
|
-
|
39
|
-
From a git repository run `git fame .`
|
40
|
-
|
41
|
-
#### Options
|
42
|
-
|
43
|
-
- `git fame --by-type` Group line counts by file extension (i.e. .rb, .erb, .yml). See the *by type* section below.
|
44
|
-
- `git fame --exclude=path1/*,path2/*` Comma separated, [glob](https://en.wikipedia.org/wiki/Glob_(programming)) file path to exclude.
|
45
|
-
- `git fame --include=path1/*,path2/*` Comma separated, [glob](https://en.wikipedia.org/wiki/Glob_(programming)) file path to include.
|
46
|
-
- `git fame --sort=loc` Order table by `loc`. Available options are: `loc`, `files` and `commits`. Default is `loc`.
|
47
|
-
- `git fame --hide-progressbar` Hide progressbar.
|
48
|
-
- `git fame --whitespace` Ignore whitespace changes when blaming files. [More about git blame and whitespace](https://coderwall.com/p/x8xbnq/git-don-t-blame-people-for-changing-whitespaces-or-moving-code).
|
49
|
-
- `git fame --repository=/path/to/repo` Git repository to be used. Default is the current folder.
|
50
|
-
- `git fame --branch=master` Branch to run on. Default is what `HEAD` points to.
|
51
|
-
- `git fame --format=output` Output format. Default is `pretty`. Additional: `csv`.
|
52
|
-
- `git fame --after=2010-01-01` Only use commits after this date. Format: yyyy-mm-dd. Note that the given date is included.
|
53
|
-
- `git fame --before=2016-02-01` Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included.
|
54
|
-
- `git fame --verbose` Print shell commands used by `git-fame`.
|
55
|
-
- `git fame --everything` Images and binaries are ignored by default. Include them as well.
|
56
|
-
- `git fame --timeout` Set timeout in seconds for each git command.
|
57
|
-
|
58
|
-
#### By type
|
59
|
-
|
60
|
-
`--by-type` adds extra columns file types.
|
61
|
-
|
62
|
-
```
|
63
|
-
+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
|
64
|
-
| name | loc | commits | files | distribution (%) | unknown | yml | md | gemspec | rb |
|
65
|
-
+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
|
66
|
-
| Linus Oleander | 914 | 106 | 21 | 94.5 / 97.2 / 100.0 | 32 | 5 | 61 | 23 | 257 |
|
67
|
-
| f1yegor | 47 | 2 | 7 | 4.9 / 1.8 / 33.3 | 3 | 5 | 6 | 1 | 10 |
|
68
|
-
| David Selassie | 6 | 1 | 2 | 0.6 / 0.9 / 9.5 | 2 | 0 | 3 | 0 | 0 |
|
69
|
-
+----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
|
70
|
-
```
|
71
|
-
|
72
|
-
### Programmatically
|
73
|
-
|
74
|
-
Want to work with the data before using it? Here's how.
|
75
|
-
|
76
|
-
#### Constructor arguments
|
77
|
-
|
78
|
-
`options` is a hash with most of the arguments passed to the binary defined above.
|
79
|
-
Take a look at the [bin/git-fame](bin/git-fame) file for more information.
|
80
|
-
|
81
|
-
``` ruby
|
82
|
-
repository = GitFame::Base.new(options)
|
83
|
-
```
|
84
|
-
|
85
|
-
#### Print table
|
86
|
-
|
87
|
-
`repository.pretty_puts` outputs the statistics as an ascii table.
|
88
|
-
|
89
|
-
|
90
|
-
#### Print csv table to console
|
91
|
-
|
92
|
-
`repository.csv_puts` outputs the statistics as csv.
|
93
|
-
|
94
|
-
#### Statistics
|
95
|
-
|
96
|
-
##### GitFame
|
97
|
-
|
98
|
-
- `repository.loc` (Fixnum) Total number of lines.
|
99
|
-
- `repository.commits` (Fixnum) Total number of commits.
|
100
|
-
- `repository.files` (Fixnum) Total number of files.
|
101
|
-
- `repository.authors` (Array< Author >) All authors.
|
102
|
-
|
103
|
-
##### Author
|
104
|
-
|
105
|
-
`author = repository.authors.first`
|
106
|
-
|
107
|
-
- Formated
|
108
|
-
- `author.loc` (String) Number of lines.
|
109
|
-
- `author.commits` (String) Number of commits.
|
110
|
-
- `author.files` (String) Number of files changed.
|
111
|
-
- Non formated
|
112
|
-
- `author.distribution` (String) Distribution (in %) between users (loc/commits/files)
|
113
|
-
- `author.raw_loc` (Fixnum) Number of lines.
|
114
|
-
- `author.raw_commits` (Fixnum) Number of commits.
|
115
|
-
- `author.raw_files` (Fixnum) Number of files changed.
|
116
|
-
- `author.file_type_counts` (Array) File types (k) and loc (v)
|
117
|
-
|
118
|
-
## Testing
|
119
|
-
|
120
|
-
1. Download fixtures (`spec/fixtures`) using `git submodule update --init`.
|
121
|
-
2. Run rspec using `bundle exec rspec`.
|
122
|
-
|
123
|
-
Note that `puts` has been disabled to avoid unnecessary output during testing.
|
124
|
-
Visit `spec/spec_helper.rb` to enable it again.
|
125
|
-
|
126
|
-
## Contributing
|
127
|
-
|
128
|
-
1. Fork it
|
129
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
130
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
131
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
132
|
-
5. Create new Pull Request
|
133
|
-
|
134
|
-
## Requirements
|
135
|
-
|
136
|
-
*GitFame* should work on all Unix based operating system with Git installed.
|
137
|
-
|
138
|
-
## License
|
139
|
-
|
140
|
-
*GitFame* is released under the *MIT license*.
|
data/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
|
3
|
-
require "bundler/gem_tasks"
|
4
|
-
require "method_profiler"
|
5
|
-
require "git_fame"
|
6
|
-
|
7
|
-
task :profile do
|
8
|
-
profiler = MethodProfiler.observe(GitFame::Base)
|
9
|
-
|
10
|
-
GitFame::Base.new({
|
11
|
-
repository: "spec/fixtures/gash"
|
12
|
-
})
|
13
|
-
|
14
|
-
puts profiler.report
|
15
|
-
end
|
data/bin/git-fame
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
|
4
|
-
|
5
|
-
require "git_fame"
|
6
|
-
require "trollop"
|
7
|
-
|
8
|
-
opts = Trollop::options do
|
9
|
-
version "git-fame #{GitFame::VERSION} (c) 2012-#{Date.today.year} Linus Oleander"
|
10
|
-
opt :repository, "What git repository should be used?", default: "."
|
11
|
-
opt :sort, "What should the printed table be sorted by? #{GitFame::SORT.join(", ")}", default: "loc", type: String
|
12
|
-
opt :"hide-progressbar", "Hide progressbar", default: false
|
13
|
-
opt :whitespace, "Ignore whitespace changes", default: false
|
14
|
-
opt :"by-type", "Group line counts by file extension (i.e. .rb, .erb, .yml)", default: false
|
15
|
-
opt :include, "Comma separated, glob file path to include. I.e path/*.rb", default: "", type: String
|
16
|
-
opt :exclude, "Comma separated, glob file path to exclude. I.e any/**/path/*", default: "", type: String
|
17
|
-
opt :extension, "Comma-separated list of extensions to consider, leave blank for all", default: "", type: String
|
18
|
-
opt :branch, "Branch to run on", default: "master", type: String
|
19
|
-
opt :format, "Format (pretty/csv)", default: "pretty", type: String
|
20
|
-
opt :after, "Only use commmits after this date. Format: yyyy-mm-dd. Note that the given date is included", type: String
|
21
|
-
opt :before, "Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included", type: String
|
22
|
-
opt :verbose, "Print shell commands used by git-fame", default: false
|
23
|
-
opt :timeout, "Set timeout in seconds for each git command. Turn off by using -1", type: Integer, default: GitFame::CMD_TIMEOUT
|
24
|
-
opt :everything, "Images and binaries are ignored by default. Include them as well", default: false
|
25
|
-
end
|
26
|
-
|
27
|
-
unless GitFame::SORT.include?(opts[:sort])
|
28
|
-
Trollop::die :sort, "must be one of the following; #{GitFame::SORT.join(", ")}"
|
29
|
-
end
|
30
|
-
|
31
|
-
if opts[:timeout] != -1 and opts[:timeout] <= 0
|
32
|
-
Trollop::die :timeout, "must be positive"
|
33
|
-
end
|
34
|
-
|
35
|
-
begin
|
36
|
-
fame = GitFame::Base.new({
|
37
|
-
repository: opts[:repository],
|
38
|
-
progressbar: ! opts[:"hide-progressbar"],
|
39
|
-
sort: opts[:sort],
|
40
|
-
whitespace: opts[:whitespace],
|
41
|
-
by_type: opts[:"by-type"],
|
42
|
-
include: opts[:include],
|
43
|
-
exclude: opts[:exclude],
|
44
|
-
extensions: opts[:extension],
|
45
|
-
branch: opts[:branch],
|
46
|
-
after: opts[:after],
|
47
|
-
before: opts[:before],
|
48
|
-
verbose: opts[:verbose],
|
49
|
-
everything: opts[:everything],
|
50
|
-
timeout: opts[:timeout]
|
51
|
-
})
|
52
|
-
|
53
|
-
opts[:format] == "csv" ? fame.csv_puts : fame.pretty_puts
|
54
|
-
rescue GitFame::Error => e
|
55
|
-
Trollop::die e.message
|
56
|
-
rescue Timeout::Error
|
57
|
-
Trollop::die "Maximum timeout of #{opts[:timeout]} sec exceed. Try passing --timeout=<sec> or -1 for no timeout"
|
58
|
-
end
|