diffy 3.0.6 → 3.0.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of diffy might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c0e0aee65a3f2117cd159a9eb746a1b9c79f880
4
- data.tar.gz: 1b80f76baedd405410f97dfeb1eb9ed692e7c458
3
+ metadata.gz: 2cd5d2b187c4063456f8a018845cfa199d09b345
4
+ data.tar.gz: 9e83a4e588db04b655db5c64c30e8fda39201b4b
5
5
  SHA512:
6
- metadata.gz: 491022a9aefc2c9a6b78228b6ba93a53363d7afbc28173d171ee841aaeabbb4eaa4a6d89679ec11e8d34fc7edfaa4a883cfdae2adb9051016f81ebc574d7b1ad
7
- data.tar.gz: 59bfeadc59bf5186fe14305aa64a0b89cc35ff3878926635ac4b8414ccf86157a5e27ce193d9c4849f8590c854c4b304764a1c4521b1d47dd72415f634abaa65
6
+ metadata.gz: b031cbc1697f4334aa62df5eff024c51e89546225f386a38345feac5e73590bb7992862032c7fd99741a0c1e4fb47e7819c06348b72a7efbc70d88ce46172ec5
7
+ data.tar.gz: e524bece45facd115127d8f1a8814f0b8acc94b77e54caa87931312db00693d8ab55ebff76c00321733d13f04c8635d3d242c11389881f1ff83ad3a3748fe64a
@@ -9,3 +9,4 @@
9
9
  * printercu
10
10
  * Bryan Ricker
11
11
  * JasonBarnabe
12
+ * Skye Shaw
data/README.md CHANGED
@@ -30,25 +30,29 @@ Installation
30
30
 
31
31
  ###on Windows:
32
32
 
33
- 1. ensure that you have a working `which` and `diff` on your machine and on
34
- your search path.
33
+ 1. Ensure that you have a working `diff` on your machine and in your search path.
35
34
 
36
- There are two options:
35
+ There are several options:
37
36
 
38
- 1. install unxutils <http://sourceforge.net/projects/unxutils>
37
+ 1. Install [Diff::LCS](https://github.com/halostatue/diff-lcs), which includes `ldiff`. [RSpec](https://www.relishapp.com/rspec/docs/gettingstarted)
38
+ depends on Diff::LCS so you may already have it installed.
39
+
40
+ 1. If you're using [RubyInstaller](http://rubyinstaller.org), install the [devkit](http://rubyinstaller.org/add-ons/devkit).
41
+
42
+ 1. Install unxutils <http://sourceforge.net/projects/unxutils>
39
43
 
40
44
  note that these tools contain diff 2.7 which has a different handling
41
45
  of whitespace in the diff results. This makes Diffy spec tests
42
46
  yielding one fail on Windows.
43
47
 
44
- 2. install these two individually from the gnuwin32 project
48
+ 1. Install these two individually from the gnuwin32 project
45
49
  <http://gnuwin32.sourceforge.net/>
46
50
 
47
51
  note that this delivers diff 2.8 which makes Diffy spec pass
48
52
  even on Windows.
49
53
 
50
54
 
51
- 2. install the gem by
55
+ 2. Install the gem by
52
56
 
53
57
  gem install diffy
54
58
 
@@ -51,7 +51,7 @@ module Diffy
51
51
 
52
52
  if WINDOWS
53
53
  # don't use open3 on windows
54
- cmd = "\"#{diff_bin}\" #{diff_options.join(' ')} #{paths.map{|s| "\"#{s}\""}.join(' ')}"
54
+ cmd = sprintf '"%s" %s %s', diff_bin, diff_options.join(' '), paths.map { |s| %("#{s}") }.join(' ')
55
55
  diff = `#{cmd}`
56
56
  else
57
57
  diff = Open3.popen3(diff_bin, *(diff_options + paths)) { |i, o, e| o.read }
@@ -142,15 +142,20 @@ module Diffy
142
142
  def diff_bin
143
143
  return @@bin if @@bin
144
144
 
145
- @@bin ||= ""
146
- if WINDOWS
147
- @@bin = `which diff.exe`.chomp if @@bin.empty?
145
+ if @@bin = ENV['DIFFY_DIFF']
146
+ # system() trick from Minitest
147
+ raise "Can't execute diff program '#@@bin'" unless system(@@bin, __FILE__, __FILE__)
148
+ return @@bin
148
149
  end
149
- @@bin = `which diff`.chomp if @@bin.empty?
150
150
 
151
- if @@bin.empty?
151
+ diffs = ['diff', 'ldiff']
152
+ diffs.first << '.exe' if WINDOWS # ldiff does not have exe extension
153
+ @@bin = diffs.find { |name| system(name, __FILE__, __FILE__) }
154
+
155
+ if @@bin.nil?
152
156
  raise "Can't find a diff executable in PATH #{ENV['PATH']}"
153
157
  end
158
+
154
159
  @@bin
155
160
  end
156
161
 
@@ -1,3 +1,3 @@
1
1
  module Diffy
2
- VERSION = '3.0.6'
2
+ VERSION = '3.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffy
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Goldstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-25 00:00:00.000000000 Z
11
+ date: 2014-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake