ydiffy 0.0.2 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: da837db923dccfb81fd25331f0e4794515df2923
4
- data.tar.gz: 8a26000dde88219122ad677300c2de7fa8ea32cd
2
+ SHA256:
3
+ metadata.gz: 6ba6d4ccacd12fd0225293d29cc5c827718cf3b55f2b2ce665b382c2a489fa24
4
+ data.tar.gz: 6a5dc28e465b9ae4c0796ad23cbfe5950e4f802ec0def086f8e2580586a641d0
5
5
  SHA512:
6
- metadata.gz: 3e3b15cd46a23f88c9b07eafcd7ba5499ee98a017e8cc6fafd456969f490aa459c03efa9956a6680e27a81d79f1563c57ee55beba59c61eb03d975e8a0e564d0
7
- data.tar.gz: e72a6a7a66f12e601fbf04db1dcd1330f3b5ee4f04eebac703081aa20f65fd31e19b64e14e3b0ddd24d75f2c32e61afe51833bba8270b1d80b21a41cd86c2a80
6
+ metadata.gz: 5f66bdf4b7b2d7f9f882215bdf5f13312f5a1fa3bcf5203a1d0f09d81a454bcece5aa06016b7793b8cc27fc214b5470a85847baacef4ebb3e9d974bd84b68094
7
+ data.tar.gz: 8e6517141b2b2302d37a7d633b55b8bfc36cac7440968d006963f4154a82189447cb2835d5db200c6a7b750e602f0b442926a4f715db2fb745babbf0e30aab12
data/README.md CHANGED
@@ -30,7 +30,7 @@ Installation
30
30
  ------------
31
31
 
32
32
  ### on Unix
33
-
33
+ gem build
34
34
  gem install diffy
35
35
 
36
36
  ### on Windows:
data/lib/diffy/css.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
3
  CSS = <<-STYLE
3
4
  .diff{overflow:auto;}
data/lib/diffy/diff.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
3
  class Diff
3
4
  ORIGINAL_DEFAULT_OPTIONS = {
@@ -37,7 +38,7 @@ module Diffy
37
38
  if ! ['strings', 'files'].include?(@options[:source])
38
39
  raise ArgumentError, "Invalid :source option #{@options[:source].inspect}. Supported options are 'strings' and 'files'."
39
40
  end
40
- @string1, @string2 = string1, string2
41
+ @string1, @string2 = to_utf8(string1), to_utf8(string2)
41
42
  end
42
43
 
43
44
  def diff
@@ -141,6 +142,16 @@ module Diffy
141
142
  end
142
143
  private
143
144
 
145
+ def to_utf8(line)
146
+ return unless line
147
+ return line if line.encoding.to_s.eql?('UTF-8')
148
+ begin
149
+ line.encode!('UTF-8')
150
+ rescue
151
+ line.force_encoding('UTF-8')
152
+ end
153
+ end
154
+
144
155
  @@bin = nil
145
156
  def diff_bin
146
157
  return @@bin if @@bin
data/lib/diffy/format.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
3
  module Format
3
4
  # ANSI color output suitable for terminal output
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
3
  class HtmlFormatter
3
4
 
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
3
  class SplitDiff
3
4
  def initialize(left, right, options = {})
data/lib/diffy/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Diffy
2
- VERSION = '0.0.2'
3
+ VERSION = '0.0.4'
3
4
  end
data/lib/diffy.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'tempfile'
2
3
  require 'erb'
3
4
  require 'rbconfig'
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.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Goldstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-22 00:00:00.000000000 Z
11
+ date: 2023-01-16 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
- rubyforge_project:
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