diffy 3.0.3 → 3.0.4
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 +7 -0
- data/CHANGELOG +7 -0
- data/lib/diffy/html_formatter.rb +4 -1
- data/lib/diffy/version.rb +1 -1
- data/spec/diffy_spec.rb +17 -0
- metadata +48 -68
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c5716dc0b3aaa576d3508caa867fda44afa56805
|
4
|
+
data.tar.gz: c2fdc0cb2057feaeb1c397348824e533d7ee8e3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e1b38543c84b1bafb3a2374af78bde66b448a5c775a00f702db17a0edb74573c8ca480c652205c34ec25fbaaf654f0d1af9b876c04d0667f059764f33bfe2b7
|
7
|
+
data.tar.gz: 044a96352f2556c5314e89b196ad3eb6002602dd9d19200abec2760d597fb999a998f85189cf3739a9dc435645d45b60ff29de500c90408d1f3b97fe270a2e7a
|
data/CHANGELOG
CHANGED
data/lib/diffy/html_formatter.rb
CHANGED
@@ -88,7 +88,10 @@ module Diffy
|
|
88
88
|
|
89
89
|
def split_characters(chunk)
|
90
90
|
chunk.gsub(/^./, '').each_line.map do |line|
|
91
|
-
|
91
|
+
chars = line.sub(/([\r\n]$)/, '').split('')
|
92
|
+
# add escaped newlines
|
93
|
+
chars << '\n'
|
94
|
+
chars.map{|chr| ERB::Util.h(chr) }
|
92
95
|
end.flatten.join("\n") + "\n"
|
93
96
|
end
|
94
97
|
|
data/lib/diffy/version.rb
CHANGED
data/spec/diffy_spec.rb
CHANGED
@@ -486,6 +486,23 @@ baz
|
|
486
486
|
@diff.to_s(:html).should == html
|
487
487
|
end
|
488
488
|
|
489
|
+
it "should treat unix vs windows newlines as differences" do
|
490
|
+
@diff = Diffy::Diff.new("one\ntwo\nthree\n", "one\r\ntwo\r\nthree\r\n")
|
491
|
+
html = <<-HTML
|
492
|
+
<div class="diff">
|
493
|
+
<ul>
|
494
|
+
<li class="del"><del>one</del></li>
|
495
|
+
<li class="del"><del>two</del></li>
|
496
|
+
<li class="del"><del>three</del></li>
|
497
|
+
<li class="ins"><ins>one<strong></strong></ins></li>
|
498
|
+
<li class="ins"><ins>two<strong></strong></ins></li>
|
499
|
+
<li class="ins"><ins>three<strong></strong></ins></li>
|
500
|
+
</ul>
|
501
|
+
</div>
|
502
|
+
HTML
|
503
|
+
@diff.to_s(:html).should == html
|
504
|
+
end
|
505
|
+
|
489
506
|
describe 'with lines that include \n' do
|
490
507
|
before do
|
491
508
|
string1 = 'a\nb'"\n"
|
metadata
CHANGED
@@ -1,64 +1,53 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: diffy
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 3.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.4
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Sam Goldstein
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-04-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: rake
|
22
|
-
|
23
|
-
|
24
|
-
none: false
|
25
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
26
17
|
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
32
20
|
type: :development
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rspec
|
36
21
|
prerelease: false
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.0'
|
47
34
|
type: :development
|
48
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.0'
|
49
41
|
description: Convenient diffing in ruby
|
50
|
-
email:
|
42
|
+
email:
|
51
43
|
- sgrock@gmail.org
|
52
44
|
executables: []
|
53
|
-
|
54
45
|
extensions: []
|
55
|
-
|
56
46
|
extra_rdoc_files: []
|
57
|
-
|
58
|
-
|
59
|
-
- .
|
60
|
-
- .
|
61
|
-
- .travis.yml
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rspec"
|
50
|
+
- ".travis.yml"
|
62
51
|
- CHANGELOG
|
63
52
|
- CONTRIBUTORS
|
64
53
|
- Gemfile
|
@@ -75,38 +64,29 @@ files:
|
|
75
64
|
- spec/demo_app.rb
|
76
65
|
- spec/diffy_spec.rb
|
77
66
|
homepage: http://github.com/samg/diffy
|
78
|
-
licenses:
|
67
|
+
licenses:
|
79
68
|
- MIT
|
69
|
+
metadata: {}
|
80
70
|
post_install_message:
|
81
71
|
rdoc_options: []
|
82
|
-
|
83
|
-
require_paths:
|
72
|
+
require_paths:
|
84
73
|
- lib
|
85
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
|
87
|
-
requirements:
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
88
76
|
- - ">="
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
version: "0"
|
94
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
|
-
requirements:
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
97
81
|
- - ">="
|
98
|
-
- !ruby/object:Gem::Version
|
99
|
-
|
100
|
-
segments:
|
101
|
-
- 0
|
102
|
-
version: "0"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
103
84
|
requirements: []
|
104
|
-
|
105
85
|
rubyforge_project:
|
106
|
-
rubygems_version:
|
86
|
+
rubygems_version: 2.2.0
|
107
87
|
signing_key:
|
108
|
-
specification_version:
|
88
|
+
specification_version: 4
|
109
89
|
summary: A convenient way to diff string in ruby
|
110
|
-
test_files:
|
90
|
+
test_files:
|
111
91
|
- spec/demo_app.rb
|
112
92
|
- spec/diffy_spec.rb
|