irwi 0.0.0 → 0.1.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{irwi}
8
- s.version = "0.0.0"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Noskov"]
@@ -1,7 +1,7 @@
1
1
  class Irwi::Comparators::Base
2
2
 
3
3
  def render_changes( old_text, new_text )
4
- build_changes( old_text, new_text ).join('')
4
+ build_changes( old_text, new_text ).join('').gsub( /\r?\n/, '<br />' )
5
5
  end
6
6
 
7
7
  protected
@@ -34,4 +34,12 @@ describe Irwi::Comparators::DiffLcs do
34
34
  @c.render_changes('AdDA',nil).should == '<span class="removed">AdDA</span>'
35
35
  end
36
36
 
37
+ specify "should change \\n to <br />" do
38
+ @c.render_changes("AdDA\nhhh",'').should == '<span class="removed">AdDA<br />hhh</span>'
39
+ end
40
+
41
+ specify "should change \\r\\n to <br />" do
42
+ @c.render_changes("AdDA\r\nhhh",'').should == '<span class="removed">AdDA<br />hhh</span>'
43
+ end
44
+
37
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: irwi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Noskov