lib/githelp/changes.rb in githelp-0.1.0 vs lib/githelp/changes.rb in githelp-0.1.1

- old
+ new

@@ -1,19 +1,36 @@ # coding: utf-8 module Githelp + def git_log_wc(since,file) + begin + `git log --oneline --since='#{since}' #{file} | wc` + rescue + nil + end + end + def changed(since) files(true).find_all { |file| - `git log --oneline --since='#{since}' #{file} | wc` !~ / 0 / + wc = git_log_wc(since,file) + if wc + wc !~ / 0 / + else + false + end } end def unchanged(since) files(true).find_all { |file| - `git log --oneline --since='#{since}' #{file} | wc` =~ / 0 / + wc = git_log_wc(since,file) + if wc + wc =~ / 0 / + else + false + end } end end -