Browse files

Configurable diff command

  • Loading branch information...
1 parent db8f034 commit d69469a93b404c4358b23fc1c4c7556a9563577e @singpolyma singpolyma committed Dec 30, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/vimgolf/cli.rb
View
5 lib/vimgolf/cli.rb
@@ -2,6 +2,7 @@ module VimGolf
GOLFHOST = ENV['GOLFHOST'] || "http://vimgolf.com"
GOLFDEBUG = ENV['GOLFDEBUG'].to_sym rescue false
+ DIFF = ENV['DIFF'] || 'diff --strip-trailing-cr'
class Error
end
@@ -72,7 +73,7 @@ def put(id = nil)
system(vimcmd)
if $?.exitstatus.zero?
- diff = `diff --strip-trailing-cr #{input(id, type)} #{output(id)}`
+ diff = `#{DIFF} #{input(id, type)} #{output(id)}`
if diff.size > 0
VimGolf.ui.warn "Uh oh, looks like your entry does not match the desired output:"
@@ -174,4 +175,4 @@ def debug(msg)
p [caller.first, msg] if GOLFDEBUG
end
end
-end
+end

0 comments on commit d69469a

Please sign in to comment.