Skip to content

Instantly share code, notes, and snippets.

@sunny
Created August 8, 2008 15:18
Show Gist options
  • Save sunny/4573 to your computer and use it in GitHub Desktop.
Save sunny/4573 to your computer and use it in GitHub Desktop.
# Fake `svnlook` for testing prupose.
# ./fake_svnlook.rb changed /home/pouet/blah/svn/kikoo -r 3483
# ^-- will just read /tmp/fakeSvn.3483 :)
abort 'only the `changed` keyword is allowed on fake_svnlook' if ARGV[0] != 'changed'
abort 'only the `-r` option is supported on fake_svnlook' if ARGV[2] != '-r'
abort "svnlook: No such revision #{ARGV[3]}" unless File.exists?(fake_svn = "/tmp/fakeSvn.#{ARGV[3]}")
puts File.read(fake_svn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment