difflcs 0.6.8 → 0.6.9
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/.gitignore +14 -0
- data/CHANGELOG +5 -2
- data/README.md +8 -0
- data/Rakefile +1 -4
- data/difflcs.gemspec +1 -2
- data/lib/diff_l_c_s.rb +16 -19
- data/lib/diff_l_c_s/version.rb +1 -1
- data/test/helper.rb +3 -1
- data/test/test_counter.rb +1 -1
- data/test/test_diff_l_c_s.rb +2 -2
- data/test/test_word_split_array.rb +1 -1
- metadata +9 -6
data/.gitignore
ADDED
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -60,8 +60,16 @@ Or install it yourself as:
|
|
60
60
|
|
61
61
|
$ gem install difflcs
|
62
62
|
|
63
|
+
Feel free to report issues and to ask questions. For the latest news on
|
64
|
+
DiffLCS:
|
65
|
+
|
66
|
+
* http://foundation.logilogi.org/tags/DiffLCS
|
67
|
+
|
63
68
|
## Contributing
|
64
69
|
|
70
|
+
If you wish to contribute, please create a pull-request and remember to update
|
71
|
+
the corresponding unit test(s).
|
72
|
+
|
65
73
|
1. Fork it
|
66
74
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
67
75
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
data/Rakefile
CHANGED
data/difflcs.gemspec
CHANGED
@@ -7,10 +7,9 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = "A resonably fast diff algoritm using longest common substrings that can also detect text that has moved"
|
8
8
|
gem.summary = "Diff algoritm that can detect text that has moved"
|
9
9
|
gem.homepage = "https://github.com/wybo/difflcs"
|
10
|
-
gem.rubyforge_project = "difflcs"
|
11
10
|
|
12
11
|
gem.files = `git ls-files`.split($\)
|
13
|
-
gem.test_files = gem.files.grep(%r{^test
|
12
|
+
gem.test_files = gem.files.grep(%r{^test/test_.*})
|
14
13
|
gem.name = "difflcs"
|
15
14
|
gem.require_paths = ["lib"]
|
16
15
|
gem.version = DiffLCS::VERSION
|
data/lib/diff_l_c_s.rb
CHANGED
@@ -4,26 +4,8 @@
|
|
4
4
|
# MIT Licensed
|
5
5
|
#++#
|
6
6
|
|
7
|
-
require "diff_l_c_s/version"
|
8
7
|
require 'position_range'
|
9
|
-
|
10
|
-
module DiffLCS
|
11
|
-
# Diffs self with other, see DiffLCS#diff
|
12
|
-
#
|
13
|
-
def diff(other, options = {})
|
14
|
-
DiffLCS.diff(self.split(''), other.split(''), options)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Diffs words in self with other, see DiffLCS#diff
|
18
|
-
#
|
19
|
-
# Words are non-spaces or groups of spaces delimited by either
|
20
|
-
# spaces or the beginning or the end of the string.
|
21
|
-
#
|
22
|
-
def word_diff(other, options = {})
|
23
|
-
DiffLCS.word_diff(self, other, options)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
8
|
+
require 'diff_l_c_s/version'
|
27
9
|
require 'diff_l_c_s/counter'
|
28
10
|
require 'diff_l_c_s/word_split_array'
|
29
11
|
|
@@ -127,4 +109,19 @@ module DiffLCS
|
|
127
109
|
:matched_new => in_new_p_r_list}
|
128
110
|
end
|
129
111
|
end
|
112
|
+
|
113
|
+
# Diffs self with other, see DiffLCS#diff
|
114
|
+
#
|
115
|
+
def diff(other, options = {})
|
116
|
+
DiffLCS.diff(self.split(''), other.split(''), options)
|
117
|
+
end
|
118
|
+
|
119
|
+
# Diffs words in self with other, see DiffLCS#diff
|
120
|
+
#
|
121
|
+
# Words are non-spaces or groups of spaces delimited by either
|
122
|
+
# spaces or the beginning or the end of the string.
|
123
|
+
#
|
124
|
+
def word_diff(other, options = {})
|
125
|
+
DiffLCS.word_diff(self, other, options)
|
126
|
+
end
|
130
127
|
end
|
data/lib/diff_l_c_s/version.rb
CHANGED
data/test/helper.rb
CHANGED
data/test/test_counter.rb
CHANGED
data/test/test_diff_l_c_s.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: difflcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 9
|
10
|
+
version: 0.6.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Wybo Wiersma
|
@@ -84,6 +84,7 @@ extensions: []
|
|
84
84
|
extra_rdoc_files: []
|
85
85
|
|
86
86
|
files:
|
87
|
+
- .gitignore
|
87
88
|
- CHANGELOG
|
88
89
|
- Gemfile
|
89
90
|
- LICENSE
|
@@ -129,10 +130,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
130
|
version: "0"
|
130
131
|
requirements: []
|
131
132
|
|
132
|
-
rubyforge_project:
|
133
|
+
rubyforge_project:
|
133
134
|
rubygems_version: 1.6.2
|
134
135
|
signing_key:
|
135
136
|
specification_version: 3
|
136
137
|
summary: Diff algoritm that can detect text that has moved
|
137
|
-
test_files:
|
138
|
-
|
138
|
+
test_files:
|
139
|
+
- test/test_counter.rb
|
140
|
+
- test/test_diff_l_c_s.rb
|
141
|
+
- test/test_word_split_array.rb
|