diff-lcs 1.2.3 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9eaea5f8fa364e74d93c2721fd6cb20c6fa9d65e
4
+ data.tar.gz: 7cd7569297e671da52b753db36ad4128d109fddf
5
+ SHA512:
6
+ metadata.gz: 33ec7c9966bd92aaa989d561a3895cccb1321809ef784dde9757b39ebc9162dd3ba0dc322a089c48dc7a706531c85d1dbbaa3203cd837b4db57059f74563901d
7
+ data.tar.gz: bad9e1d0f49830f81feba65cf8e0542c3e9ac8d50f4e0663712be639ff377832fad701e299279081b35b48655c0563c7269c0b7e432bf590232ede1cf397a5b6
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --colour
2
- --format documentation
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,83 @@
1
+ ## Contributing
2
+
3
+ I value any contribution to Diff::LCS you can provide: a bug report, a feature
4
+ request, or code contributions. Code contributions to Diff::LCS are especially
5
+ <del>welcome</del>encouraged. Because Diff::LCS is a complex codebase, there
6
+ are a few guidelines:
7
+
8
+ * Code changes *will not* be accepted without tests. The test suite is
9
+ written with [RSpec][].
10
+ * Match my coding style.
11
+ * Use a thoughtfully-named topic branch that contains your change. Rebase
12
+ your commits into logical chunks as necessary.
13
+ * Use [quality commit messages][].
14
+ * Do not change the version number; when your patch is accepted and a release
15
+ is made, the version will be updated at that point.
16
+ * Submit a GitHub pull request with your changes.
17
+ * New or changed behaviours require appropriate documentation.
18
+
19
+ ### Test Dependencies
20
+
21
+ Diff::LCS uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
22
+ a number of rake tasks. You will mostly be interested in:
23
+
24
+ $ rake
25
+
26
+ which runs the tests the same way that:
27
+
28
+ $ rake spec
29
+ $ rake travis
30
+
31
+ will do.
32
+
33
+ To assist with the installation of the development dependencies, I have
34
+ provided a Gemfile pointing to the (generated) `diff-lcs.gemspec` file. This
35
+ will permit you to do:
36
+
37
+ $ bundle install
38
+
39
+ to get the development dependencies. If you aleady have `hoe` installed, you
40
+ can accomplish the same thing with:
41
+
42
+ $ rake newb
43
+
44
+ This task will install any missing dependencies, run the tests/specs, and
45
+ generate the RDoc.
46
+
47
+ You can run tests with code coverage analysis by running:
48
+
49
+ $ rake spec:coverage
50
+
51
+ ### Workflow
52
+
53
+ Here's the most direct way to get your work merged into the project:
54
+
55
+ * Fork the project.
56
+ * Clone down your fork (`git clone git://github.com/<username>/diff-lcs.git`).
57
+ * Create a topic branch to contain your change (`git checkout -b
58
+ my_awesome_feature`).
59
+ * Hack away, add tests. Not necessarily in that order.
60
+ * Make sure everything still passes by running `rake`.
61
+ * If necessary, rebase your commits into logical chunks, without errors.
62
+ * Push the branch up (`git push origin my_awesome_feature`).
63
+ * Create a pull request against halostatue/diff-lcs and describe what your
64
+ change does and the why you think it should be merged.
65
+
66
+ ### Contributors
67
+
68
+ * Austin Ziegler created Diff::LCS.
69
+
70
+ Thanks to everyone else who has contributed to Diff::LCS:
71
+
72
+ * Kenichi Kamiya
73
+ * Michael Granger
74
+ * Vít Ondruch
75
+ * Jon Rowe
76
+ * Koichi Ito
77
+ * Josef Strzibny
78
+ * Josh Bronson
79
+ * Mark Friedgan
80
+
81
+ [Rspec]: http://rspec.info/documentation/
82
+ [quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
83
+ [Hoe]: https://github.com/seattlerb/hoe
@@ -0,0 +1,220 @@
1
+ ## 1.3 / 2017-01-18
2
+
3
+ * Bugs fixed:
4
+
5
+ * Fixed an error for bin/ldiff --version. Fixes [issue #21][].
6
+ * Force Diff::LCS::Change and Diff::LCS::ContextChange to only perform
7
+ equality comparisons against themselves. Provided by Kevin Mook in
8
+ [pull request #29][].
9
+ * Fix tab expansion in htmldiff, provided by Mark Friedgan in
10
+ [pull request #25][].
11
+ * Silence Ruby 2.4 Fixnum deprecation warnings. Fixxues [issue #38][] and
12
+ [pull request#36][].
13
+ * Ensure that test dependencies are loaded properly. Fixes [issue #33][]
14
+ and [pull request #34][].
15
+ * Fix [issue #1][] with incorrect intuition of patch direction. Tentative
16
+ fix, but the previous failure cases pass now.
17
+
18
+ * Tooling changes:
19
+
20
+ * Added SimpleCov and Coveralls support.
21
+ * Change the homepage (temporarily) to the GitHub repo.
22
+ * Updated testing and gem infrastructure.
23
+ * Modernized the specs.
24
+
25
+ * Cleaned up documentation.
26
+
27
+ * Added a Code of Conduct.
28
+
29
+ ## 1.2.5 / 2013-11-08
30
+
31
+ * Bugs fixed:
32
+
33
+ * Comparing arrays flattened them too far, especially with
34
+ Diff::LCS.sdiff. Fixed by Josh Bronson in [pull request #23][].
35
+
36
+ ## 1.2.4 / 2013-04-20
37
+
38
+ * Bugs fixed:
39
+
40
+ * A bug was introduced after 1.1.3 when pruning common sequences at the
41
+ start of comparison. Paul Kunysch (@pck) fixed this in
42
+ [pull request #18][]. Thanks!
43
+
44
+ * The Rubinius (1.9 mode) bug in [rubinius/rubinius#2268][] has been
45
+ fixed by the Rubinius team two days after it was filed. Thanks for
46
+ fixing this so quickly!
47
+
48
+ * Switching to Raggi's hoe-gemspec2 for gemspec generation.
49
+
50
+ ## 1.2.3 / 2013-04-11
51
+
52
+ * Bugs Fixed:
53
+
54
+ * The new encoding detection for diff output generation (added in 1.2.2)
55
+ introduced a bug if the left side of the comparison was the empty set.
56
+ Originally found in [rspec/rspec-expectations#238][] and
57
+ [rspec/rspec-expectations#239][]. Jon Rowe developed a reasonable
58
+ heuristic (left side, right side, empty string literal) to avoid this
59
+ bug.
60
+ * There is a known issue with Rubinius in 1.9 mode reported in
61
+ [rubinius/rubinius#2268][] and demonstrated in the Travis CI builds.
62
+ For all other tested platforms, diff-lcs is considered stable. As soon
63
+ as a suitably small test-case can be created for the Rubinius team to
64
+ examine, this will be added to the Rubinius issue around this.
65
+
66
+ ## 1.2.2 / 2013-03-30
67
+
68
+ * Bugs Fixed:
69
+
70
+ * Diff::LCS::Hunk could not properly generate a difference for comparison
71
+ sets that are not US-ASCII-compatible because of the use of literal
72
+ regular expressions and strings. Jon Rowe found this in
73
+ [rspec/rspec-expectations#219][] and provided a first pass
74
+ implementation in [pull request #15][]. I've reworked it because of
75
+ test failures in Rubinius when running in Ruby 1.9 mode. This coerces
76
+ the added values to the encoding of the old dataset (as determined by
77
+ the first piece of the old dataset).
78
+ * Adding Travis CI testing for Ruby 2.0.
79
+
80
+ ## 1.2.1 / 2013-02-09
81
+
82
+ * Bugs Fixed:
83
+
84
+ * As seen in [rspec/rspec-expectations#200][], the release of
85
+ Diff::LCS 1.2 introduced an unnecessary public API change to
86
+ Diff::LCS::Hunk (see the change at
87
+ [rspec/rspec-expectations@3d6fc82c][] for details). The new method name
88
+ (and behaviour) is more correct, but I should not have renamed the
89
+ function or should have at least provided an alias. This release
90
+ restores Diff::LCS::Hunk#unshift as an alias to #merge. Note that the
91
+ old #unshift behaviour was incorrect and will not be restored.
92
+
93
+ ## 1.2.0 / 2013-01-21
94
+
95
+ * Minor Enhancements:
96
+
97
+ * Added special case handling for Diff::LCS.patch so that it handles
98
+ patches that are empty or contain no changes.
99
+ * Added two new methods (#patch\_me and #unpatch\_me) to the includable
100
+ module.
101
+
102
+ * Bugs Fixed:
103
+
104
+ * Fixed [issue #1][] patch direction detection.
105
+ * Resolved [issue #2][] by handling `string[string.size, 1]` properly (it
106
+ returns `""` not `nil`).
107
+ * Michael Granger (ged) fixed an implementation error in
108
+ Diff::LCS::Change and added specs in [pull request #8][]. Thanks!
109
+ * Made the code auto-testable.
110
+ * Vít Ondruch (voxik) provided the latest version of the GPL2 license
111
+ file in [pull request #10][]. Thanks!
112
+ * Fixed a documentation issue with the includable versions of #patch! and
113
+ #unpatch! where they implied that they would replace the original
114
+ value. Given that Diff::LCS.patch always returns a copy, the
115
+ documentation was incorrect and has been corrected. To provide the
116
+ behaviour that was originally documented, two new methods were added to
117
+ provide this behaviour. Found by scooter-dangle in [issue #12][].
118
+ Thanks!
119
+
120
+ * Code Style Changes:
121
+
122
+ * Removed trailing spaces.
123
+ * Calling class methods using `.` instead of `::`.
124
+ * Vít Ondruch (voxik) removed unnecessary shebangs in [pull request #9][].
125
+ Thanks!
126
+ * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
127
+ lucky [pull request #13][]. Thanks!
128
+ * Embarked on a major refactoring to make the files a little more
129
+ manageable and understand the code on a deeper level.
130
+ * Adding to http://travis-ci.org.
131
+
132
+ ## 1.1.3 / 2011-08-27
133
+
134
+ * Converted to 'hoe' for release.
135
+ * Converted tests to RSpec 2.
136
+ * Extracted the body of htmldiff into a class available from
137
+ diff/lcs/htmldiff.
138
+ * Migrated development and issue tracking to GitHub.
139
+ * Bugs fixed:
140
+
141
+ * Eliminated the explicit use of RubyGems in both bin/htmldiff and
142
+ bin/ldiff. Resolves [issue #4][].
143
+ * Eliminated Ruby warnings. Resolves [issue #3][].
144
+
145
+ ## 1.1.2 / 2004-10-20
146
+
147
+ * Fixed a problem reported by Mauricio Fernandez in htmldiff.
148
+
149
+ ## 1.1.1 / 2004-09-25
150
+
151
+ * Fixed bug #891 (Set returned from patch command does not contain last equal
152
+ part).
153
+ * Fixed a problem with callback initialisation code (it assumed that all
154
+ callbacks passed as classes can be initialised; now, it rescues
155
+ NoMethodError in the event of private :new being called).
156
+ * Modified the non-initialisable callbacks to have a private #new method.
157
+ * Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
158
+
159
+ ## 1.1.0 / -
160
+
161
+ * Eliminated the need for Diff::LCS::Event and removed it.
162
+ * Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
163
+ * Implemented patching/unpatching for standard Diff callback output formats
164
+ with both #diff and #sdiff.
165
+ * Extensive documentation changes.
166
+
167
+ ## 1.0.4
168
+
169
+ * Fixed a problem with bin/ldiff output, especially for unified format.
170
+ Newlines that should have been present weren't.
171
+ * Changed the .tar.gz installer to generate Windows batch files if ones do
172
+ not exist already. Removed the existing batch files as they didn't work.
173
+
174
+ ## 1.0.3
175
+
176
+ * Fixed a problem with #traverse\_sequences where the first difference from
177
+ the left sequence might not be appropriately captured.
178
+
179
+ ## 1.0.2
180
+
181
+ * Fixed an issue with ldiff not working because actions were changed from
182
+ symbols to strings.
183
+
184
+ ## 1.0.1
185
+
186
+ * Minor modifications to the gemspec, the README.
187
+ * Renamed the diff program to ldiff (as well as the companion batch file) so
188
+ as to not collide with the standard diff program.
189
+ * Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
190
+ latest CVS version.
191
+
192
+ ## 1.0
193
+
194
+ * Initial release based mostly on Perl's Algorithm::Diff.
195
+
196
+ [rubinius/rubinius#2268]: https://github.com/rubinius/rubinius/issues/2268
197
+ [rspec/rspec-expectations#239]: https://github.com/rspec/rspec-expectations/issues/239
198
+ [rspec/rspec-expectations#238]: https://github.com/rspec/rspec-expectations/issues/238
199
+ [rspec/rspec-expectations#219]: https://github.com/rspec/rspec-expectations/issues/219
200
+ [rspec/rspec-expectations@3d6fc82c]: https://github.com/rspec/rspec-expectations/commit/3d6fc82c
201
+ [rspec/rspec-expectations#200]: https://github.com/rspec/rspec-expectations/pull/200
202
+ [pull request #36]: https://github.com/halostatue/diff-lcs/pull/36
203
+ [pull request #34]: https://github.com/halostatue/diff-lcs/pull/34
204
+ [pull request #29]: https://github.com/halostatue/diff-lcs/pull/29
205
+ [pull request #25]: https://github.com/halostatue/diff-lcs/pull/25
206
+ [pull request #23]: https://github.com/halostatue/diff-lcs/pull/23
207
+ [pull request #18]: https://github.com/halostatue/diff-lcs/pull/18
208
+ [pull request #15]: https://github.com/halostatue/diff-lcs/pull/15
209
+ [pull request #13]: https://github.com/halostatue/diff-lcs/pull/13
210
+ [pull request #10]: https://github.com/halostatue/diff-lcs/pull/10
211
+ [pull request #9]: https://github.com/halostatue/diff-lcs/pull/9
212
+ [pull request #8]: https://github.com/halostatue/diff-lcs/pull/8
213
+ [issue #38]: https://github.com/halostatue/diff-lcs/issues/38
214
+ [issue #33]: https://github.com/halostatue/diff-lcs/issues/33
215
+ [issue #21]: https://github.com/halostatue/diff-lcs/issues/21
216
+ [issue #12]: https://github.com/halostatue/diff-lcs/issues/12
217
+ [issue #4]: https://github.com/halostatue/diff-lcs/issues/4
218
+ [issue #3]: https://github.com/halostatue/diff-lcs/issues/3
219
+ [issue #2]: https://github.com/halostatue/diff-lcs/issues/2
220
+ [issue #1]: https://github.com/halostatue/diff-lcs/issues/1
File without changes
@@ -1,19 +1,14 @@
1
- .autotest
2
- .gemtest
3
- .hoerc
4
1
  .rspec
5
- .travis.yml
6
- Contributing.rdoc
7
- Gemfile
8
- History.rdoc
9
- License.rdoc
2
+ Code-of-Conduct.md
3
+ Contributing.md
4
+ History.md
5
+ License.md
10
6
  Manifest.txt
11
7
  README.rdoc
12
8
  Rakefile
13
9
  autotest/discover.rb
14
10
  bin/htmldiff
15
11
  bin/ldiff
16
- diff-lcs.gemspec
17
12
  docs/COPYING.txt
18
13
  docs/artistic.txt
19
14
  lib/diff-lcs.rb
@@ -29,9 +24,12 @@ lib/diff/lcs/ldiff.rb
29
24
  lib/diff/lcs/string.rb
30
25
  spec/change_spec.rb
31
26
  spec/diff_spec.rb
27
+ spec/fixtures/ds1.csv
28
+ spec/fixtures/ds2.csv
32
29
  spec/hunk_spec.rb
33
30
  spec/issues_spec.rb
34
31
  spec/lcs_spec.rb
32
+ spec/ldiff_spec.rb
35
33
  spec/patch_spec.rb
36
34
  spec/sdiff_spec.rb
37
35
  spec/spec_helper.rb
@@ -1,9 +1,11 @@
1
1
  = Diff::LCS
2
2
 
3
- home :: http://diff-lcs.rubyforge.org/
4
- code :: https://github.com/halostatue/diff-lcs
5
- bugs :: https://github.com/halostatue/diff-lcs/issues
6
- rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
3
+ home :: https://github.com/halostatue/diff-lcs
4
+ code :: https://github.com/halostatue/diff-lcs
5
+ bugs :: https://github.com/halostatue/diff-lcs/issues
6
+ rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
7
+ continuous integration :: {<img src="https://travis-ci.org/halostatue/diff-lcs.svg" />}[https://travis-ci.org/halostatue/diff-lcs]
8
+ test coverage :: {<img src="https://coveralls.io/repos/halostatue/diff-lcs/badge.svg" alt="Coverage Status" />}[https://coveralls.io/r/halostatue/diff-lcs]
7
9
 
8
10
  == Description
9
11
 
@@ -11,16 +13,10 @@ Diff::LCS computes the difference between two Enumerable sequences using the
11
13
  McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
12
14
  to create a simple HTML diff output format and a standard diff-like tool.
13
15
 
14
- This is release 1.2.3, fixing a bug in value comparison where the left side of
15
- the comparison was the empty set, preventing the detection of encoding. Thanks
16
- to Jon Rowe for fixing this issue. This is a strongly recommended release.
17
-
18
- *Note*: There is a known issue with Rubinius in 1.9 mode reported in
19
- {rubinius/rubinius#2268}[https://github.com/rubinius/rubinius/issues/2268] and
20
- demonstrated in the Travis CI builds. For all other tested platforms, diff-lcs
21
- is considered stable. As soon as a suitably small test-case can be created for
22
- the Rubinius team to examine, this will be added to the Rubinius issue around
23
- this.
16
+ This is release 1.3, providing a tentative fix to a long-standing issue related
17
+ to incorrect detection of a patch direction. Also modernizes the gem
18
+ infrastructure, testing infrastructure, and provides a warning-free experience
19
+ to Ruby 2.4 users.
24
20
 
25
21
  == Synopsis
26
22
 
@@ -71,16 +67,17 @@ or Array will perform best.
71
67
  Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt
72
68
  longest common subsequence (LCS) algorithm to compute intelligent differences
73
69
  between two sequenced enumerable containers. The implementation is based on
74
- Mario I. Wolczko's {Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st]
70
+ Mario I. Wolczko's
71
+ {Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st]
75
72
  (1993) and Ned Konz's Perl version
76
73
  {Algorithm::Diff 1.15}[http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/].
74
+ Diff::LCS#sdiff and Diff::LCS#traverse_balanced were originally written for the
75
+ Perl version by Mike Schilli.
77
76
 
78
- This library is called Diff::LCS because of an early version of Algorithm::Diff
79
- which was restrictively licensed.
80
-
81
- == Continuous Integration Status
82
-
83
- {<img src="https://travis-ci.org/halostatue/diff-lcs.png" />}[https://travis-ci.org/halostatue/diff-lcs]
77
+ The algorithm is described in <em>A Fast Algorithm for Computing Longest Common
78
+ Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor
79
+ improvements to improve the speed. A simplified description of the algorithm,
80
+ originally written for the Perl version, was written by Mark-Jason Dominus.
84
81
 
85
82
  :include: Contributing.rdoc
86
83