olde_code_finder 0.0.7 → 0.0.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d45c246fadab214519b8402077cf0438c87ecb5
4
- data.tar.gz: 15a42634315cfa95ac6b9541a3ce576c0dde1f2c
3
+ metadata.gz: 55f602dbf531a6419161df5551ed6a3d8f06961f
4
+ data.tar.gz: 959ce2966cd0e8fc43904579e8a971aa938b53b6
5
5
  SHA512:
6
- metadata.gz: f201c9944542b5722c7a67a6a5eac097c7eca2d48b98bd9e6e21c427cc309b865ddc950709e33f88b727f84356f1e6a29c3a1940fe813f92dfbca33ab9d84bd4
7
- data.tar.gz: 1eaa22f5d033ebe559b413961522cb40efc804ce31e6d936519c8c248f7a8e5742ca9cbf82a1eb880d44c3082d8412f539a49b40986b26e636e9c5d0e67441f3
6
+ metadata.gz: cb7801c4da1d63e29872eaf1da15c19d833eaa3dcf7c77faf3c2479b75d4c99fa5b6609fd3fc465373b006605174f93c30b78740ae781061c7dd0fb2ed03f68c
7
+ data.tar.gz: 37325bc906635f14bb5ba4a886c8636373b4d00bde52aa955d5c66a2f64012a64b9bb37d34ad29e60874fae2cc58af5df3596d078e3306f0bdfff38e537794b9
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ Jan 30, 2015: 0.0.8
2
+ Skip empty files (Joe Rafaniello)
3
+
1
4
  Jan 29, 2015: 0.0.7
2
5
  Show percentage of old lines (Joe Rafaniello)
3
6
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OldeCodeFinder
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
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-29 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler