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 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
@@ -1,3 +1,10 @@
1
+ == 3.0.4 ==
2
+ handle windows vs. unix line breaks consistently in html output
3
+
4
+ == 3.0.3 ==
5
+ explicitly unlink tempfiles to avoid occasional file handle leaks
6
+
7
+ == 3.0.0 ==
1
8
  allow_empty_diff is true by default
2
9
 
3
10
  == 2.1.0 ==
@@ -88,7 +88,10 @@ module Diffy
88
88
 
89
89
  def split_characters(chunk)
90
90
  chunk.gsub(/^./, '').each_line.map do |line|
91
- (line.chomp.split('') + ['\n']).map{|chr| ERB::Util.h(chr) }
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
@@ -1,3 +1,3 @@
1
1
  module Diffy
2
- VERSION = '3.0.3'
2
+ VERSION = '3.0.4'
3
3
  end
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
- hash: 1
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
- date: 2014-03-16 00:00:00 Z
19
- dependencies:
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
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
26
17
  - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
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
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ~>
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 2
45
- - 0
46
- version: "2.0"
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
- version_requirements: *id002
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
- files:
59
- - .gitignore
60
- - .rspec
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
- none: false
87
- requirements:
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
88
76
  - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 3
91
- segments:
92
- - 0
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
- hash: 3
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: 1.8.15
86
+ rubygems_version: 2.2.0
107
87
  signing_key:
108
- specification_version: 3
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