olde_code_finder 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +3 -0
- data/lib/olde_code_finder/finder.rb +4 -0
- data/lib/olde_code_finder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55f602dbf531a6419161df5551ed6a3d8f06961f
|
4
|
+
data.tar.gz: 959ce2966cd0e8fc43904579e8a971aa938b53b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb7801c4da1d63e29872eaf1da15c19d833eaa3dcf7c77faf3c2479b75d4c99fa5b6609fd3fc465373b006605174f93c30b78740ae781061c7dd0fb2ed03f68c
|
7
|
+
data.tar.gz: 37325bc906635f14bb5ba4a886c8636373b4d00bde52aa955d5c66a2f64012a64b9bb37d34ad29e60874fae2cc58af5df3596d078e3306f0bdfff38e537794b9
|
data/ChangeLog
CHANGED
@@ -13,6 +13,8 @@ module OldeCodeFinder
|
|
13
13
|
def check_by_author(author)
|
14
14
|
return if binary?
|
15
15
|
total_lines = git_blame_output.size
|
16
|
+
return if total_lines == 0
|
17
|
+
|
16
18
|
author_lines = git_blame_output.grep(/#{author}/).size
|
17
19
|
actual_percent = calculate_percent(author_lines, total_lines)
|
18
20
|
if actual_percent > pctg.to_f
|
@@ -25,6 +27,8 @@ module OldeCodeFinder
|
|
25
27
|
years_ago = date_string.match(/^(\d+)/)[1].to_i
|
26
28
|
date_threshold = (Date.today - (years_ago*365))
|
27
29
|
total_lines = git_blame_output.size
|
30
|
+
return if total_lines == 0
|
31
|
+
|
28
32
|
older_lines = git_blame_output.select {|line| Date.strptime(line.match(/.*(\d{4}-\d{2}-\d{2})/)[1]) < date_threshold }.size
|
29
33
|
actual_percent = calculate_percent(older_lines, total_lines)
|
30
34
|
if actual_percent > pctg.to_f
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: olde_code_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Copeland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|