summaryrefslogtreecommitdiff
path: root/rake_tasks
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-04-28 13:58:47 +0000
committermurphy <murphy@rubychan.de>2010-04-28 13:58:47 +0000
commite5c7cbb44722db5671cef5391d0a2ecbee41dce5 (patch)
treede17beca8e886c4206b7e53adfa2e147594d928e /rake_tasks
parente84bb5d9cf6a40bafbde0c3bcc3c99adbfd18c09 (diff)
downloadcoderay-e5c7cbb44722db5671cef5391d0a2ecbee41dce5.tar.gz
diff task now supports repositories which have a folder named "diff".
Diffstat (limited to 'rake_tasks')
-rw-r--r--rake_tasks/diff.rake19
1 files changed, 12 insertions, 7 deletions
diff --git a/rake_tasks/diff.rake b/rake_tasks/diff.rake
index 9cd67b9..bdbb458 100644
--- a/rake_tasks/diff.rake
+++ b/rake_tasks/diff.rake
@@ -15,17 +15,21 @@ class Differ < Hash
def scan(path = @path)
Dir.chdir path do
- system 'svn diff > diff'
- if File.size? 'diff'
+ diff_file_name = 'diff'
+ if File.directory? 'diff'
+ diff_file_name = 'diff.diff'
+ end
+ system "svn diff > #{diff_file_name}"
+ if File.size? diff_file_name
puts FORMAT %
[
path,
- count(:LOC, `wc -l diff`.to_i),
- count(:changes, `grep ^@@ diff | wc -l`.to_i),
- count(:files, `grep ^Index diff | wc -l`.to_i),
+ count(:LOC, `wc -l #{diff_file_name}`.to_i),
+ count(:changes, `grep ^@@ #{diff_file_name} | wc -l`.to_i),
+ count(:files, `grep ^Index #{diff_file_name} | wc -l`.to_i),
]
else
- rm 'diff'
+ rm diff_file_name
end
end
end
@@ -39,7 +43,8 @@ class Differ < Hash
def clean(path = @path)
Dir.chdir path do
- rm 'diff' if File.exist? 'diff'
+ rm 'diff' if File.file? 'diff'
+ rm 'diff.diff' if File.file? 'diff.diff'
end
end