olde_code_finder 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bffaebf325fa79dfd8d52a7dc51191ce2b1060ea
4
- data.tar.gz: 461d91bafb6f2a66c3874763525b8ec7f4b841f0
3
+ metadata.gz: 0b87bd384b4ecdfffab49055cff0dcc97d1c3b32
4
+ data.tar.gz: ea435c3ff5ea35f3c2feb2cdd10dc5bae06a7e93
5
5
  SHA512:
6
- metadata.gz: 1f932c922b3939735bfbc9b3b361de1afafaf42e5055c636f4045cdd3500eab5f04232f0a52af72f7e08924e98196ac7789dc41a3378ef68b7898d57f16e5795
7
- data.tar.gz: fdc101e9e715beed29600eb733796ceb142582284692a7473b50169292778c3d00db8585077de95350e2b7b45a931308cf986547afcdf5d93d05af1dd0e1326d
6
+ metadata.gz: bc73009fed83f593862ea034d9028cfcb7314db0c537797c4a6c75524aa331473caf081d626bd1783e28721dcc6b93ec381e4350e7212fe7eb04ced8e0550e74
7
+ data.tar.gz: c1e514fe0eb9d24585b21d2eef08933ae1f129a4ed9b57f76674f591c56eef29bddd9469f569a01bf3ae75a99b57149511ee3dc915a3d8729f99941fb701e786
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ Sep 24, 2014: 0.0.6
2
+ Filter out binary files.
3
+
1
4
  Sep 24, 2014: 0.0.5
2
5
  Filter out directories from globs like app/**/*.
3
6
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module OldeCodeFinder
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: olde_code_finder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Copeland