wdiff 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/lib/wdiff.rb +1 -1
- data/spec/wdiff_spec.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -4,8 +4,8 @@ Simple wrapper around GNU wdiff (http://www.gnu.org/software/wdiff/)
|
|
4
4
|
|
5
5
|
== Usage
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
* 'this is a test'.wdiff('this is another test') # => 'this is [-a-] {+another+} test'
|
8
|
+
* Wdiff::Helper.to_html('this is a test'.wdiff('this is another test')) # => 'this is <span class="out">a</span> <span class="in">another</span> test'
|
9
9
|
|
10
10
|
== Contributing to wdiff
|
11
11
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/wdiff.rb
CHANGED
@@ -20,7 +20,7 @@ module Wdiff
|
|
20
20
|
|
21
21
|
module Helper
|
22
22
|
def self.to_html(str)
|
23
|
-
str.gsub(/\[\-/,'<
|
23
|
+
str.gsub(/\[\-/,'<del>').gsub(/\-\]/,'</del>').gsub(/\{\+/,'<ins>').gsub(/\+\}/,'</ins>')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/spec/wdiff_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe "Wdiff" do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should return the HTML diff of two strings" do
|
9
|
-
Wdiff::Helper.to_html('this is a test'.wdiff('this is another test')).should == 'this is <
|
9
|
+
Wdiff::Helper.to_html('this is a test'.wdiff('this is another test')).should == 'this is <del>a</del> <ins>another</ins> test'
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should raise error if xdiff is not in $PATH" do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wdiff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jerome Riga
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-23 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|