di 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/README.rdoc +22 -0
  2. data/Rakefile +4 -0
  3. data/bin/di +11 -6
  4. data/di.gemspec +1 -2
  5. metadata +2 -3
  6. data/VERSION +0 -1
data/README.rdoc CHANGED
@@ -35,6 +35,26 @@ default settings and some original features:
35
35
 
36
36
  Run di --help for help.
37
37
 
38
+ == USAGE:
39
+
40
+ Just use di(1) for diff(1).
41
+
42
+ If you want to use this with svn, you should have a non-paginating
43
+ version of di because svn calls the external diff for each changed
44
+ file:
45
+
46
+ ln di ndi
47
+
48
+ With a default option set in your shell's startup file:
49
+
50
+ NDI_OPTIONS=--no-pager
51
+ export NDI_OPTIONS
52
+
53
+ Then finally set diff-cmd to the command in ~/.subversion/config.
54
+
55
+ [helpers]
56
+ diff-cmd = ndi
57
+
38
58
  == REQUIREMENTS:
39
59
 
40
60
  - Ruby 1.8.7 or later
@@ -45,6 +65,8 @@ Run di --help for help.
45
65
 
46
66
  gem install di
47
67
 
68
+ Or just put bin/di to a directory in your PATH.
69
+
48
70
  == COPYRIGHT:
49
71
 
50
72
  Copyright (c) 2008, 2009, 2010 Akinori MUSHA
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
+ load "bin/di"
5
+
4
6
  begin
5
7
  require 'jeweler'
6
8
  Jeweler::Tasks.new do |gem|
@@ -17,6 +19,8 @@ EOS
17
19
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
18
20
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
21
  gem.executables = ["di"]
22
+
23
+ gem.version = MYVERSION
20
24
  end
21
25
  Jeweler::GemcutterTasks.new
22
26
  rescue LoadError
data/bin/di CHANGED
@@ -28,11 +28,12 @@
28
28
  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29
29
  # SUCH DAMAGE.
30
30
 
31
- MYVERSION = "0.1.3"
31
+ MYVERSION = "0.1.7"
32
32
  MYNAME = File.basename($0)
33
33
  MYCOPYRIGHT = "Copyright (c) 2008, 2009, 2010 Akinori MUSHA"
34
34
 
35
35
  DIFF_CMD = ENV.fetch('DIFF', 'diff')
36
+ ENV_NAME = "#{MYNAME.tr('-a-z', '_A-Z')}_OPTIONS"
36
37
  EMPTYFILE = '/dev/null'
37
38
 
38
39
  RSYNC_EXCLUDE_GLOBS = %w(
@@ -369,10 +370,14 @@ Options marked as [!] sign are turned on by default. To turn them off,
369
370
  specify -?- for short options and --no-??? for long options, respectively.
370
371
 
371
372
  Environment variables:
372
- DIFF Path to diff(1)
373
- DI_OPTIONS User's preferred default options
374
- PAGER Path to pager (more(1) is used if not defined)
375
373
  EOS
374
+ [
375
+ ['DIFF', 'Path to diff(1)'],
376
+ [ENV_NAME, 'User\'s preferred default options'],
377
+ ['PAGER', 'Path to pager (more(1) is used if not defined)'],
378
+ ].each { |name, description|
379
+ printf " %-14s %s\n", name, description
380
+ }
376
381
  exit 0
377
382
  }
378
383
  }
@@ -382,7 +387,7 @@ EOS
382
387
  '--pager', '--color',
383
388
  '-U3', '-N', '-r', '-p', '-d')
384
389
 
385
- if value = ENV['DI_OPTIONS']
390
+ if value = ENV[ENV_NAME]
386
391
  require 'shellwords'
387
392
  opts.parse(*value.shellsplit)
388
393
  end
@@ -814,4 +819,4 @@ def colorize_context_diff(io)
814
819
  io.close
815
820
  end
816
821
 
817
- main(ARGV)
822
+ main(ARGV) if $0 == __FILE__
data/di.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{di}
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
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"]
@@ -27,7 +27,6 @@ default settings and some original features.
27
27
  "LICENSE",
28
28
  "README.rdoc",
29
29
  "Rakefile",
30
- "VERSION",
31
30
  "bin/di",
32
31
  "di.gemspec",
33
32
  "test/helper.rb",
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Akinori MUSHA
@@ -48,7 +48,6 @@ files:
48
48
  - LICENSE
49
49
  - README.rdoc
50
50
  - Rakefile
51
- - VERSION
52
51
  - bin/di
53
52
  - di.gemspec
54
53
  - test/helper.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.6