ydiffy 0.0.2 → 0.0.3
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.
- checksums.yaml +5 -5
- data/lib/diffy/diff.rb +11 -1
- data/lib/diffy/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ebdabe7fec38695e1803b5d909e2c022de065545fe277f291897484e9393db0a
|
4
|
+
data.tar.gz: a6d4c054837d86ebf9728699b9d7758fa40ddd76e527aaddcd3e74cf7ea1b1b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b283c2a765a052b9e4737bbca15f554bd31795463d3823409c88af2248f8952c82b509486d1ab8ff146b4b3674ce54743d2ccc7782b1cb2d6df5348274e30935
|
7
|
+
data.tar.gz: fb54cf453e43fe74eab822d84544f39ed399d44acb9efc6ae41ce58af3610fce917ea9cef8133eaae81225b0c2def1e59ecfbf4a1d5aed3f3d12aa7b204c0cea
|
data/lib/diffy/diff.rb
CHANGED
@@ -37,7 +37,7 @@ module Diffy
|
|
37
37
|
if ! ['strings', 'files'].include?(@options[:source])
|
38
38
|
raise ArgumentError, "Invalid :source option #{@options[:source].inspect}. Supported options are 'strings' and 'files'."
|
39
39
|
end
|
40
|
-
@string1, @string2 = string1, string2
|
40
|
+
@string1, @string2 = to_utf8(string1), to_utf8(string2)
|
41
41
|
end
|
42
42
|
|
43
43
|
def diff
|
@@ -141,6 +141,16 @@ module Diffy
|
|
141
141
|
end
|
142
142
|
private
|
143
143
|
|
144
|
+
def to_utf8(line)
|
145
|
+
return unless line
|
146
|
+
return line if line.encoding.to_s.eql?('UTF-8')
|
147
|
+
if /ISO-8859-1/.match(line.encoding.to_s)
|
148
|
+
line.encode!('UTF-8')
|
149
|
+
else
|
150
|
+
line.force_encoding('UTF-8')
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
144
154
|
@@bin = nil
|
145
155
|
def diff_bin
|
146
156
|
return @@bin if @@bin
|
data/lib/diffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ydiffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Goldstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
|
87
|
-
rubygems_version: 2.6.8
|
86
|
+
rubygems_version: 3.2.3
|
88
87
|
signing_key:
|
89
88
|
specification_version: 4
|
90
89
|
summary: Ydiffy is a fork of diffy to work around a problem in odba
|