di 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY +11 -1
- data/README.rdoc +13 -7
- data/VERSION +1 -1
- data/bin/di +13 -4
- data/di.gemspec +2 -2
- metadata +3 -3
data/HISTORY
CHANGED
@@ -1,9 +1,19 @@
|
|
1
|
-
|
1
|
+
== 0.1.6 2010-03-11
|
2
|
+
|
3
|
+
* Fix colorization of the last hunk.
|
4
|
+
|
5
|
+
* Reimplement --version.
|
6
|
+
|
7
|
+
== 0.1.5 2010-03-10
|
2
8
|
|
3
9
|
* Add --[no-]color and colorize diff output by default.
|
4
10
|
|
5
11
|
* Read user's preferred default options from DI_OPTIONS.
|
6
12
|
|
13
|
+
== 0.1.4 2010-03-10
|
14
|
+
|
15
|
+
* Add --[no-]pager and turn it on by default.
|
16
|
+
|
7
17
|
* Do not choke on file names starting with a hyphen.
|
8
18
|
|
9
19
|
== 0.1.3 2010-03-10
|
data/README.rdoc
CHANGED
@@ -11,19 +11,25 @@ di - a wrapper around GNU diff(1)
|
|
11
11
|
The di(1) command wraps around GNU diff(1) to provide reasonable
|
12
12
|
default settings and some original features:
|
13
13
|
|
14
|
-
-
|
15
|
-
VCS administration files, etc. a la rsync(1)'s --cvs-ignore
|
16
|
-
option.
|
14
|
+
- Useful options turned on by default: -U3 -N -p -d.
|
17
15
|
|
18
|
-
-
|
16
|
+
- Diff output is colorized, and paginated by user's favorite pager.
|
17
|
+
|
18
|
+
- Non-significant files are ignored by default, such as backup
|
19
|
+
files, object files, VCS administration files, etc. a la
|
20
|
+
rsync(1)'s --cvs-ignore option.
|
19
21
|
|
20
|
-
-
|
22
|
+
- Ignore difference of lines containing RCS tags.
|
21
23
|
|
22
24
|
- Perform recursive comparison.
|
23
25
|
|
24
|
-
-
|
26
|
+
- Support combinations of command line options that GNU diff(1) is
|
27
|
+
expected to but does not support.
|
28
|
+
|
29
|
+
- Default set of options are configurable via environment variable.
|
25
30
|
|
26
|
-
-
|
31
|
+
- Any option can be negated from a command line. (Specify -N- to
|
32
|
+
negate the default -N, etc.)
|
27
33
|
|
28
34
|
== SYNOPSIS:
|
29
35
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/bin/di
CHANGED
@@ -30,6 +30,7 @@
|
|
30
30
|
|
31
31
|
MYVERSION = "0.1.3"
|
32
32
|
MYNAME = File.basename($0)
|
33
|
+
MYCOPYRIGHT = "Copyright (c) 2008, 2009, 2010 Akinori MUSHA"
|
33
34
|
|
34
35
|
DIFF_CMD = ENV.fetch('DIFF', 'diff')
|
35
36
|
EMPTYFILE = '/dev/null'
|
@@ -350,7 +351,14 @@ usage: #{MYNAME} [flags] [files]
|
|
350
351
|
}
|
351
352
|
opts.on('-v', '--version',
|
352
353
|
'Output version info.') { |val|
|
353
|
-
|
354
|
+
print <<-"EOF"
|
355
|
+
#{MYNAME} version #{MYVERSION}
|
356
|
+
#{MYCOPYRIGHT}
|
357
|
+
|
358
|
+
----
|
359
|
+
EOF
|
360
|
+
system(DIFF_CMD, '--version')
|
361
|
+
exit
|
354
362
|
}
|
355
363
|
opts.on('--help',
|
356
364
|
'Output this help.') { |val|
|
@@ -680,9 +688,9 @@ def colorize_unified_diff(io)
|
|
680
688
|
color = colors[:file1]
|
681
689
|
when /^-{3} /
|
682
690
|
color = colors[:file2]
|
683
|
-
when /^@@ -[0-9]+,([0-9]+)/
|
691
|
+
when /^@@ -[0-9]+,([0-9]+) \+[0-9]+,([0-9]+)/
|
684
692
|
state = :hunk
|
685
|
-
hunk_left = $1.to_i
|
693
|
+
hunk_left = $1.to_i + $2.to_i
|
686
694
|
line.sub!(/^(@@ .*? @@)( )?/) {
|
687
695
|
$1 + ($2 ? colors[:off] + $2 + colors[:function] : '')
|
688
696
|
}
|
@@ -695,6 +703,7 @@ def colorize_unified_diff(io)
|
|
695
703
|
case line
|
696
704
|
when /^\+/
|
697
705
|
color = colors[:new]
|
706
|
+
hunk_left -= 1
|
698
707
|
check = $diff.highlight_whitespace
|
699
708
|
when /^-/
|
700
709
|
color = colors[:old]
|
@@ -702,7 +711,7 @@ def colorize_unified_diff(io)
|
|
702
711
|
check = $diff.highlight_whitespace
|
703
712
|
when /^ /
|
704
713
|
color = colors[:unchanged]
|
705
|
-
hunk_left -=
|
714
|
+
hunk_left -= 2
|
706
715
|
else
|
707
716
|
# error
|
708
717
|
color = colors[:comment]
|
data/di.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{di}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Akinori MUSHA"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-11}
|
13
13
|
s.default_executable = %q{di}
|
14
14
|
s.description = %q{The di(1) command wraps around GNU diff(1) to provide reasonable
|
15
15
|
default settings and some original features.
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 6
|
9
|
+
version: 0.1.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Akinori MUSHA
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-11 00:00:00 +09:00
|
18
18
|
default_executable: di
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|