wdiff 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/wdiff.rb +7 -3
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,3 +1,4 @@
1
+ require 'tempfile'
1
2
  module Wdiff
2
3
  class << self
3
4
  def included(target)
@@ -13,9 +14,12 @@ module Wdiff
13
14
  end
14
15
 
15
16
  def wdiff(str_new)
16
- cmd = "bash -c '#{Wdiff::bin_path} <(echo \"#{self}\") <(echo \"#{str_new}\")'"
17
- raw = %x{#{cmd}}
18
- raw.chop unless raw.nil?
17
+ f1, f2 = Tempfile.new('f1'), Tempfile.new('f2')
18
+ f1.write(self); f1.flush
19
+ f2.write(str_new); f2.flush
20
+ raw = %x{#{Wdiff::bin_path} #{f1.path} #{f2.path}}
21
+ f1.close; f2.close
22
+ raw
19
23
  end
20
24
 
21
25
  module Helper
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wdiff
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jerome Riga