gitstat 0.1.1
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 +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/bin/console +14 -0
- data/bin/gitstat +5 -0
- data/bin/setup +8 -0
- data/gitstat.gemspec +25 -0
- data/lib/gitstat.rb +9 -0
- data/lib/gitstat/cli.rb +27 -0
- data/lib/gitstat/version.rb +3 -0
- metadata +100 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fc4cf56b40bf3bd967301ed14ad8101618b0664e
|
4
|
+
data.tar.gz: 28b3c9d7a59baf3e64fa6c42caae487fb3a37248
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6ea28a0cd0ccd3c8f1ee0fc1f360079f3800ef3a18f4a80e852298d87a49ebeadd1d92fd81577a6cf6d1eafc2d1e9be5a50f8864a353e716b020ca1e4aeab60c
|
7
|
+
data.tar.gz: 3cf3f3ff5e8c544cc53a62258cb3de01ce89aba834587dfcd6ebab48c80f53eaade720d236bbf4ba84221c56d7659523d8c98f48c450363a7b72d9344f75475f
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 DilumN
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Gitstat
|
2
|
+
|
3
|
+
Gitstat is a ruby gem for `git log` your repository to get valuable informations for each Author in your repository
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install gitstat
|
8
|
+
|
9
|
+
## Usage
|
10
|
+
|
11
|
+
After installing the gem, go to your repository & just type `gitstat`. Then you will get the total number of added lines / deleted lines & commits by each author in the repository.
|
12
|
+
|
13
|
+
```
|
14
|
+
Author >>>> //de
|
15
|
+
lines added: +11839 lines | deleted: -16271 lines | total commits: 368
|
16
|
+
************************************************************************************
|
17
|
+
|
18
|
+
Author >>>> Adrian Hosey
|
19
|
+
lines added: +52 lines | deleted: -10 lines | total commits: 2
|
20
|
+
************************************************************************************
|
21
|
+
|
22
|
+
Author >>>> Alex Grigorovich
|
23
|
+
lines added: +3 lines | deleted: -1 lines | total commits: 1
|
24
|
+
************************************************************************************
|
25
|
+
|
26
|
+
```
|
27
|
+
|
28
|
+
To get total number of added lines / deleted lines & commits by each author in a given period,
|
29
|
+
|
30
|
+
`gitstat time 05/22/2015 04/30/2016`
|
31
|
+
|
32
|
+
|
33
|
+
More features coming soon.....
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dilumn/gitstat. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
38
|
+
|
39
|
+
|
40
|
+
## License
|
41
|
+
|
42
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
43
|
+
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "gitstat"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/gitstat
ADDED
data/bin/setup
ADDED
data/gitstat.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gitstat/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gitstat"
|
8
|
+
spec.version = Gitstat::VERSION
|
9
|
+
spec.authors = ["DilumN"]
|
10
|
+
spec.email = ["dilumnavanjana@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Git Log for each author in the repository with added / deleted total number of lines & total commits}
|
13
|
+
spec.description = %q{Gitstats is a ruby gem for `git log` your repository to get valuable informations for each Author in your repository}
|
14
|
+
spec.homepage = "http://dilumn.github.io"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
|
18
|
+
spec.files = %w(LICENSE.txt README.md gitstat.gemspec) + Dir['bin/*'] + Dir['lib/**/*.rb']
|
19
|
+
spec.executables = Dir['bin/*'].map { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
25
|
+
end
|
data/lib/gitstat.rb
ADDED
data/lib/gitstat/cli.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
module Gitstat
|
3
|
+
class CLI
|
4
|
+
|
5
|
+
def initialize(*)
|
6
|
+
if ARGV.empty?
|
7
|
+
blank
|
8
|
+
elsif ARGV[0] == "time"
|
9
|
+
time
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def blank
|
15
|
+
str = %q{git log --format='%aN' | sort -u | while read name; do echo "Author >>>> " "$name\t"; git log --numstat --pretty="%H" --author="$name" | awk 'NF==3 {plus+=$1; minus+=$2} NF==1 {total++} END {printf("lines added: +%d lines \t | \t deleted: -%d lines \t | \t total commits: %d\n**************************************************************************\n\n", plus, minus, total)}' -; done}
|
16
|
+
exec str
|
17
|
+
end
|
18
|
+
|
19
|
+
def time(*)
|
20
|
+
from = ARGV[1]
|
21
|
+
to = ARGV[2]
|
22
|
+
str = %q{git log --format='%aN' | sort -u | while read name; do echo "Author >>>> " "$name\t"; git log --numstat --pretty="%H" --author="$name"} + %{ --since '#{from}' --until '#{to}' } + %q{| awk 'NF==3 {plus+=$1; minus+=$2} NF==1 {total++} END {printf("******************************************\nlines added: \t +%d lines \ndeleted: \t -%d lines \ntotal commits: \t %d\n******************************************\n\n", plus, minus, total)}' -; done}
|
23
|
+
exec str
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitstat
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- DilumN
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Gitstats is a ruby gem for `git log` your repository to get valuable
|
56
|
+
informations for each Author in your repository
|
57
|
+
email:
|
58
|
+
- dilumnavanjana@gmail.com
|
59
|
+
executables:
|
60
|
+
- console
|
61
|
+
- gitstat
|
62
|
+
- setup
|
63
|
+
extensions: []
|
64
|
+
extra_rdoc_files: []
|
65
|
+
files:
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- bin/console
|
69
|
+
- bin/gitstat
|
70
|
+
- bin/setup
|
71
|
+
- gitstat.gemspec
|
72
|
+
- lib/gitstat.rb
|
73
|
+
- lib/gitstat/cli.rb
|
74
|
+
- lib/gitstat/version.rb
|
75
|
+
homepage: http://dilumn.github.io
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.5.1
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Git Log for each author in the repository with added / deleted total number
|
99
|
+
of lines & total commits
|
100
|
+
test_files: []
|