git_evolution 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 60bfaea797ed777510a8c4f99684fda966a1cc1b
4
+ data.tar.gz: 795f12647c399d9c5f50a5a9bedff8863a5e0099
5
+ SHA512:
6
+ metadata.gz: a6a9523c1ccbb8897b73ac661bc911b2431321d6bab13ac2ba882e832b5561b37d99a57ef315e30c6ceac6ada3442af1b87883b9a86fb4555ff083bff2c8d3e6
7
+ data.tar.gz: 29469fc6c07388b645d431bd0479f88b6704fbf85ce02cb02444e7f170499e6b1afa7b62b8d6682a04b9721a69817ae7cb96e8a36e331355ee83fde6a9ab0696
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.2.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in git_evolution.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Kevin Jalbert
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 all
13
+ 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 THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # GitEvolution
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'git_evolution'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install git_evolution
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/kevinjalbert/git_evolution/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/git-evolution ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'git_evolution'
4
+
5
+ GitEvolution.new.run(ARGV)
data/bin/git_evolution ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'git_evolution'
4
+
5
+ GitEvolution.new.run(ARGV)
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'git_evolution/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'git_evolution'
8
+ spec.version = GitEvolution::VERSION
9
+ spec.authors = ['Kevin Jalbert']
10
+ spec.email = ['kevin.j.jalbert@gmail.com']
11
+ spec.summary = 'Gem that provides the ability to determine the evolution of code within a git repository'
12
+ spec.description = 'Gem that provides the ability to determine the evolution of code within a git repository'
13
+ spec.homepage = ''
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ end
@@ -0,0 +1,43 @@
1
+ class GitEvolution
2
+ def run(args)
3
+ start_line = args[0]
4
+ end_line = args[1]
5
+ file = args[2]
6
+
7
+ results = `git --no-pager log -L#{start_line},#{end_line}:#{file} --follow #{file}`
8
+
9
+ commit_shas = results.scan(/^commit ([0-9a-f]{40})/)
10
+ commit_shas = commit_shas.flatten
11
+
12
+ commit_info = {}
13
+ commit_shas.each do |sha|
14
+ commit = `git --no-pager show -s --format=%an%n%n%at%n%n%s%n%n%b #{sha}`
15
+ commit_data = commit.split("\n\n")
16
+ commit_info[sha] = {
17
+ author: commit_data[0],
18
+ date: commit_data[1],
19
+ title: commit_data[2],
20
+ body: commit_data[3..-1].join
21
+ }
22
+ end
23
+
24
+ ownership = Hash.new(0)
25
+
26
+ puts 'Commits:'
27
+ commit_info.each do |sha, data|
28
+ puts "#{data[:author]} (#{Time.at(data[:date].to_i)}) - #{sha}"
29
+ puts "#{data[:title]}"
30
+ puts
31
+
32
+ ownership[data[:author]] = ownership[data[:author]] + 1
33
+ end
34
+
35
+ puts '-' * 80
36
+
37
+ puts
38
+ puts 'Ownership:'
39
+ ownership.each do |author, count|
40
+ puts "#{author} - #{count}/#{commit_info.size} (#{(count.to_f / commit_info.size * 100).round(2)}%)"
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ class GitEvolution
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: git_evolution
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Jalbert
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
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
+ description: Gem that provides the ability to determine the evolution of code within
42
+ a git repository
43
+ email:
44
+ - kevin.j.jalbert@gmail.com
45
+ executables:
46
+ - git-evolution
47
+ - git_evolution
48
+ extensions: []
49
+ extra_rdoc_files: []
50
+ files:
51
+ - ".gitignore"
52
+ - ".ruby-version"
53
+ - Gemfile
54
+ - LICENSE
55
+ - README.md
56
+ - Rakefile
57
+ - bin/git-evolution
58
+ - bin/git_evolution
59
+ - git_evolution.gemspec
60
+ - lib/git_evolution.rb
61
+ - lib/git_evolution/version.rb
62
+ homepage: ''
63
+ licenses:
64
+ - MIT
65
+ metadata: {}
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ requirements: []
81
+ rubyforge_project:
82
+ rubygems_version: 2.4.1
83
+ signing_key:
84
+ specification_version: 4
85
+ summary: Gem that provides the ability to determine the evolution of code within a
86
+ git repository
87
+ test_files: []