File: unit_diff

package info (click to toggle)
ruby-zentest 4.11.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 536 kB
  • sloc: ruby: 3,210; makefile: 13
file content (38 lines) | stat: -rwxr-xr-x 777 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env ruby -ws
#
# unit_diff - a ruby unit test filter by Ryan Davis <ryand-ruby@zenspider.com>
#
# usage:
#
#  test.rb | unit_diff [options]
#    options:
#    -b ignore whitespace differences
#    -c contextual diff
#    -h show usage
#    -k keep temp diff files around
#    -u unified diff [default]
#    -p plain diff
#    -v display version

require 'unit_diff'
require 'zentest'

############################################################

if defined? $v then
  puts "#{File.basename $0} v. #{ZenTest::VERSION}"
  exit 0
end

if defined? $h then
  File.open(__FILE__) do |f|
    begin; end until f.readline =~ /usage:/
    f.readline
    while line = f.readline and line.sub!(/^# ?/, '')
      $stderr.puts line
    end
  end
  exit 0
end

UnitDiff.unit_diff