diffy 2.0.7 → 2.0.8
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.
- data/CHANGELOG +4 -0
- data/VERSION +1 -1
- data/diffy.gemspec +2 -2
- data/lib/diffy/diff.rb +6 -1
- data/spec/diffy_spec.rb +17 -0
- data/tags +37 -0
- metadata +7 -6
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.8
|
data/diffy.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "diffy"
|
8
|
-
s.version = "2.0.
|
8
|
+
s.version = "2.0.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sam Goldstein"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-07-06"
|
13
13
|
s.description = "Convenient diffing in ruby"
|
14
14
|
s.email = "sgrock@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/diffy/diff.rb
CHANGED
@@ -46,6 +46,7 @@ module Diffy
|
|
46
46
|
end
|
47
47
|
diff_opts = options[:diff].is_a?(Array) ? options[:diff] : [options[:diff]]
|
48
48
|
diff = Open3.popen3(diff_bin, *(diff_opts + paths)) { |i, o, e| o.read }
|
49
|
+
diff.force_encoding('ASCII-8BIT') if diff.respond_to?(:valid_encoding?) && !diff.valid_encoding?
|
49
50
|
if diff =~ /\A\s*\Z/ && !options[:allow_empty_diff]
|
50
51
|
diff = case options[:source]
|
51
52
|
when 'strings' then string1
|
@@ -90,8 +91,12 @@ module Diffy
|
|
90
91
|
|
91
92
|
def tempfile(string)
|
92
93
|
t = Tempfile.new('diffy')
|
94
|
+
# ensure tempfiles aren't unlinked when GC runs by maintaining a
|
95
|
+
# reference to them.
|
96
|
+
@tempfiles ||=[]
|
97
|
+
@tempfiles.push(t)
|
93
98
|
t.print(string)
|
94
|
-
t.
|
99
|
+
t.flush
|
95
100
|
t.path
|
96
101
|
end
|
97
102
|
|
data/spec/diffy_spec.rb
CHANGED
@@ -6,6 +6,10 @@ describe Diffy::Diff do
|
|
6
6
|
describe "diffing two files" do
|
7
7
|
def tempfile(string)
|
8
8
|
t = Tempfile.new('diffy-spec')
|
9
|
+
# ensure tempfiles aren't unlinked when GC runs by maintaining a
|
10
|
+
# reference to them.
|
11
|
+
@tempfiles ||=[]
|
12
|
+
@tempfiles.push(t)
|
9
13
|
t.print(string)
|
10
14
|
t.flush
|
11
15
|
t.path
|
@@ -58,6 +62,19 @@ describe Diffy::Diff do
|
|
58
62
|
end
|
59
63
|
end
|
60
64
|
|
65
|
+
describe "with non valid UTF bytes" do
|
66
|
+
before do
|
67
|
+
string1 = "Foo ICS95095010000000000083320000BS01030000004100+\xFF00000000000000000\n"
|
68
|
+
string2 = "Bar ICS95095010000000000083320000BS01030000004100+\xFF00000000000000000\n"
|
69
|
+
@path1, @path2 = tempfile(string1), tempfile(string2)
|
70
|
+
end
|
71
|
+
it "should not raise invalid encoding issues" do
|
72
|
+
Diffy::Diff.new(@path1, @path2, :source => 'files').to_s.should == <<-DIFF
|
73
|
+
-Foo ICS95095010000000000083320000BS01030000004100+\xFF00000000000000000
|
74
|
+
+Bar ICS95095010000000000083320000BS01030000004100+\xFF00000000000000000
|
75
|
+
DIFF
|
76
|
+
end
|
77
|
+
end
|
61
78
|
|
62
79
|
end
|
63
80
|
|
data/tags
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
|
2
|
+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
|
3
|
+
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
|
4
|
+
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
5
|
+
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
6
|
+
!_TAG_PROGRAM_VERSION 5.8 //
|
7
|
+
Diff lib/diffy/diff.rb /^ class Diff$/;" c class:Diffy
|
8
|
+
Diffy lib/diffy.rb /^module Diffy; end$/;" m
|
9
|
+
Diffy lib/diffy/css.rb /^module Diffy$/;" m
|
10
|
+
Diffy lib/diffy/diff.rb /^module Diffy$/;" m
|
11
|
+
Diffy lib/diffy/format.rb /^module Diffy$/;" m
|
12
|
+
Diffy lib/diffy/html_formatter.rb /^module Diffy$/;" m
|
13
|
+
Format lib/diffy/format.rb /^ module Format$/;" m class:Diffy
|
14
|
+
HtmlFormatter lib/diffy/html_formatter.rb /^ class HtmlFormatter$/;" c class:Diffy
|
15
|
+
clean_line lib/diffy/html_formatter.rb /^ def clean_line(line)$/;" f class:Diffy.HtmlFormatter
|
16
|
+
color lib/diffy/format.rb /^ def color$/;" f class:Diffy.Format
|
17
|
+
default_format lib/diffy/diff.rb /^ def default_format$/;" f class:Diffy.Diff
|
18
|
+
default_options lib/diffy/diff.rb /^ def default_options$/;" f class:Diffy.Diff
|
19
|
+
diff lib/diffy/diff.rb /^ def diff$/;" f class:Diffy
|
20
|
+
diff_bin lib/diffy/diff.rb /^ def diff_bin$/;" f
|
21
|
+
each lib/diffy/diff.rb /^ def each$/;" f
|
22
|
+
each_chunk lib/diffy/diff.rb /^ def each_chunk$/;" f
|
23
|
+
highlight lib/diffy/html_formatter.rb /^ def highlight(lines)$/;" f class:Diffy.HtmlFormatter.clean_line.split_characters
|
24
|
+
highlighted_words lib/diffy/html_formatter.rb /^ def highlighted_words$/;" f class:Diffy.HtmlFormatter.clean_line
|
25
|
+
html lib/diffy/format.rb /^ def html$/;" f class:Diffy.Format.color
|
26
|
+
html_simple lib/diffy/format.rb /^ def html_simple$/;" f class:Diffy.Format.color
|
27
|
+
initialize lib/diffy/diff.rb /^ def initialize(string1, string2, options = {})$/;" f class:Diffy
|
28
|
+
initialize lib/diffy/html_formatter.rb /^ def initialize(diff, options = {})$/;" f class:Diffy.HtmlFormatter
|
29
|
+
reconstruct_characters lib/diffy/html_formatter.rb /^ def reconstruct_characters(line_diff, type)$/;" f class:Diffy.HtmlFormatter.clean_line.split_characters
|
30
|
+
split_characters lib/diffy/html_formatter.rb /^ def split_characters(chunk)$/;" f class:Diffy.HtmlFormatter.clean_line
|
31
|
+
tempfile lib/diffy/diff.rb /^ def tempfile(string)$/;" f
|
32
|
+
tempfile spec/diffy_spec.rb /^ def tempfile(string)$/;" f
|
33
|
+
text lib/diffy/format.rb /^ def text$/;" f class:Diffy.Format.color
|
34
|
+
to_s lib/diffy/diff.rb /^ def to_s(format = nil)$/;" f
|
35
|
+
to_s lib/diffy/html_formatter.rb /^ def to_s$/;" f class:Diffy.HtmlFormatter
|
36
|
+
wrap_line lib/diffy/html_formatter.rb /^ def wrap_line(line)$/;" f class:Diffy.HtmlFormatter
|
37
|
+
wrap_lines lib/diffy/html_formatter.rb /^ def wrap_lines(lines)$/;" f class:Diffy.HtmlFormatter.clean_line
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70226907218480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70226907218480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70226907217820 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.9.2
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70226907217820
|
36
36
|
description: Convenient diffing in ruby
|
37
37
|
email: sgrock@gmail.com
|
38
38
|
executables: []
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/diffy/html_formatter.rb
|
58
58
|
- spec/demo_app.rb
|
59
59
|
- spec/diffy_spec.rb
|
60
|
+
- tags
|
60
61
|
homepage: http://github.com/samg/diffy/tree/master
|
61
62
|
licenses: []
|
62
63
|
post_install_message:
|