olde_code_finder 0.0.5 → 0.0.6
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 +4 -4
- data/ChangeLog +3 -0
- data/lib/olde_code_finder/finder.rb +6 -0
- data/lib/olde_code_finder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b87bd384b4ecdfffab49055cff0dcc97d1c3b32
|
4
|
+
data.tar.gz: ea435c3ff5ea35f3c2feb2cdd10dc5bae06a7e93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc73009fed83f593862ea034d9028cfcb7314db0c537797c4a6c75524aa331473caf081d626bd1783e28721dcc6b93ec381e4350e7212fe7eb04ced8e0550e74
|
7
|
+
data.tar.gz: c1e514fe0eb9d24585b21d2eef08933ae1f129a4ed9b57f76674f591c56eef29bddd9469f569a01bf3ae75a99b57149511ee3dc915a3d8729f99941fb701e786
|
data/ChangeLog
CHANGED
@@ -11,6 +11,7 @@ module OldeCodeFinder
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def check_by_author(author)
|
14
|
+
return if binary?
|
14
15
|
total_lines = git_blame_output.size
|
15
16
|
author_lines = git_blame_output.grep(/#{author}/).size
|
16
17
|
if (author_lines / total_lines.to_f) > (pctg.to_f / 100.0)
|
@@ -19,6 +20,7 @@ module OldeCodeFinder
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def check_by_date(date_string)
|
23
|
+
return if binary?
|
22
24
|
years_ago = date_string.match(/^(\d+)/)[1].to_i
|
23
25
|
date_threshold = (Date.today - (years_ago*365))
|
24
26
|
total_lines = git_blame_output.size
|
@@ -30,6 +32,10 @@ module OldeCodeFinder
|
|
30
32
|
|
31
33
|
private
|
32
34
|
|
35
|
+
def binary?
|
36
|
+
`git diff --numstat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD -- #{file}`.match(/^-\t-\t/)
|
37
|
+
end
|
38
|
+
|
33
39
|
def git_blame_output
|
34
40
|
@git_blame_output ||= `git blame --date=short #{file}`.split("\n").select {|x| x !~ /\s+\d+\)\s#/ }
|
35
41
|
end
|