diff-lcs 1.2.3 → 1.4.1

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.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +0 -1
  3. data/Code-of-Conduct.md +74 -0
  4. data/Contributing.md +84 -0
  5. data/History.md +247 -0
  6. data/{License.rdoc → License.md} +0 -0
  7. data/Manifest.txt +15 -9
  8. data/README.rdoc +20 -24
  9. data/Rakefile +24 -23
  10. data/autotest/discover.rb +3 -1
  11. data/bin/htmldiff +7 -4
  12. data/bin/ldiff +4 -1
  13. data/lib/diff-lcs.rb +1 -1
  14. data/lib/diff/lcs.rb +181 -254
  15. data/lib/diff/lcs/array.rb +1 -1
  16. data/lib/diff/lcs/backports.rb +9 -0
  17. data/lib/diff/lcs/block.rb +2 -2
  18. data/lib/diff/lcs/callbacks.rb +15 -12
  19. data/lib/diff/lcs/change.rb +34 -37
  20. data/lib/diff/lcs/htmldiff.rb +17 -16
  21. data/lib/diff/lcs/hunk.rb +59 -47
  22. data/lib/diff/lcs/internals.rb +44 -40
  23. data/lib/diff/lcs/ldiff.rb +45 -65
  24. data/lib/diff/lcs/string.rb +1 -1
  25. data/spec/change_spec.rb +31 -7
  26. data/spec/diff_spec.rb +28 -18
  27. data/spec/fixtures/aX +1 -0
  28. data/spec/fixtures/bXaX +1 -0
  29. data/spec/fixtures/ds1.csv +50 -0
  30. data/spec/fixtures/ds2.csv +51 -0
  31. data/spec/fixtures/ldiff/output.diff +4 -0
  32. data/spec/fixtures/ldiff/output.diff-c +7 -0
  33. data/spec/fixtures/ldiff/output.diff-e +3 -0
  34. data/spec/fixtures/ldiff/output.diff-f +3 -0
  35. data/spec/fixtures/ldiff/output.diff-u +5 -0
  36. data/spec/hunk_spec.rb +37 -37
  37. data/spec/issues_spec.rb +60 -17
  38. data/spec/lcs_spec.rb +24 -22
  39. data/spec/ldiff_spec.rb +74 -0
  40. data/spec/patch_spec.rb +182 -180
  41. data/spec/sdiff_spec.rb +99 -87
  42. data/spec/spec_helper.rb +141 -58
  43. data/spec/traverse_balanced_spec.rb +177 -177
  44. data/spec/traverse_sequences_spec.rb +63 -63
  45. metadata +92 -188
  46. data.tar.gz.sig +0 -4
  47. data/.autotest +0 -3
  48. data/.gemtest +0 -0
  49. data/.hoerc +0 -2
  50. data/.travis.yml +0 -22
  51. data/Contributing.rdoc +0 -64
  52. data/Gemfile +0 -19
  53. data/History.rdoc +0 -135
  54. data/diff-lcs.gemspec +0 -63
  55. metadata.gz.sig +0 -0
data.tar.gz.sig DELETED
@@ -1,4 +0,0 @@
1
- GZ���y}zx���g��zQ:>���
2
- ���J��3�֎�z���w8�. �s<��?�:<]����f�D"��@c|��g��ÕM�}��](�B��0�3L�A
3
- .��9�6N�˽��-������漈KE}`4Ep ��Bg}��3��^�/fչ
4
- �Av�-�e
data/.autotest DELETED
@@ -1,3 +0,0 @@
1
- require 'rubygems'
2
-
3
- # vim: syntax=ruby
data/.gemtest DELETED
File without changes
data/.hoerc DELETED
@@ -1,2 +0,0 @@
1
- ---
2
- exclude: !ruby/regexp /(tmp|swp)$|CVS|TAGS|\.(svn|git|hg|DS_Store|idea)|Gemfile.lock|research\//
@@ -1,22 +0,0 @@
1
- ---
2
- after_script:
3
- - rake travis:after -t
4
- before_script:
5
- - gem install hoe-travis --no-rdoc --no-ri
6
- - rake travis:before -t
7
- language: ruby
8
- notifications:
9
- email: true
10
- rvm:
11
- - 2.0.0
12
- - 1.9.3
13
- - 1.9.2
14
- - ruby-head
15
- - 1.8.7
16
- - jruby-19mode
17
- - jruby-head
18
- - jruby-18mode
19
- - rbx-19mode
20
- - rbx-18mode
21
- - ree
22
- script: rake travis
@@ -1,64 +0,0 @@
1
- == Contributing
2
-
3
- I value any contribution to Diff::LCS you can provide: a bug report, a feature
4
- request, or code contributions.
5
-
6
- Code contributions to Diff::LCS are especially <del>welcome</del>encouraged.
7
- Because Diff::LCS is a complex codebase, there are a few guidelines:
8
-
9
- * Changes <strong>will not</strong> be accepted without tests.
10
- * The test suite is written with RSpec.‡
11
- * Match my coding style.
12
- * Use a thoughtfully-named topic branch that contains your change. Rebase your
13
- commits into logical chunks as necessary.
14
- * Use {quality commit messages}[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html].
15
- * Do not change the version number; when your patch is accepted and a release
16
- is made, the version will be updated at that point.
17
- * Submit a GitHub pull request with your changes.
18
- * New features require new documentation.
19
-
20
- === Test Dependencies
21
-
22
- To run the test suite, you will need to install the development dependencies
23
- for Diff::LCS. If you have Bundler, you can accomplish this easily:
24
-
25
- $ bundle install
26
-
27
- Diff::LCS uses Ryan Davis’s excellent {Hoe}[https://github.com/seattlerb/hoe]
28
- to manage the release process, and it adds a number of rake tasks. You will
29
- mostly be interested in:
30
-
31
- $ rake
32
-
33
- which runs the tests the same way that:
34
-
35
- $ rake spec
36
- $ rake test
37
- $ rake travis
38
-
39
- will do.
40
-
41
- === Workflow
42
-
43
- Here's the most direct way to get your work merged into the project:
44
-
45
- * Fork the project.
46
- * Clone down your fork (+git clone git://github.com/<username>/diff-lcs.git+).
47
- * Create a topic branch to contain your change (+git checkout -b my\_awesome\_feature+).
48
- * Hack away, add tests. Not necessarily in that order.
49
- * Make sure everything still passes by running `rake`.
50
- * If necessary, rebase your commits into logical chunks, without errors.
51
- * Push the branch up (+git push origin my\_awesome\_feature+).
52
- * Create a pull request against halostatue/diff-lcs and describe what your
53
- change does and the why you think it should be merged.
54
-
55
- === Contributors
56
-
57
- * Austin Ziegler created Diff::LCS.
58
-
59
- Thanks to everyone else who has contributed to Diff::LCS:
60
-
61
- * Kenichi Kamiya
62
- * Michael Granger
63
- * Vít Ondruch
64
- * Jon Rowe
data/Gemfile DELETED
@@ -1,19 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
-
5
- source "https://rubygems.org/"
6
-
7
- gem "hoe", "~>3.4", :group => [:development, :test]
8
- gem "hoe-bundler", "~>1.2.0", :group => [:development, :test]
9
- gem "hoe-doofus", "~>1.0.0", :group => [:development, :test]
10
- gem "hoe-gemspec", "~>1.0.0", :group => [:development, :test]
11
- gem "hoe-git", "~>1.5.0", :group => [:development, :test]
12
- gem "hoe-rubygems", "~>1.0.0", :group => [:development, :test]
13
- gem "hoe-travis", "~>1.2", :group => [:development, :test]
14
- gem "rake", "~>10.0", :group => [:development, :test]
15
- gem "rdoc", "~>3.10", :group => [:development, :test]
16
- gem "rspec", "~>2.0", :group => [:development, :test]
17
- gem "rubyforge", ">=2.0.4", :group => [:development, :test]
18
-
19
- # vim: syntax=ruby
@@ -1,135 +0,0 @@
1
- == 1.2.3 / 2013-04-11
2
-
3
- * Bugs Fixed:
4
- * The new encoding detection for diff output generation (added in 1.2.2)
5
- introduced a bug if the left side of the comparison was the empty set.
6
- Originally found in rspec/rspec-expectations#238 and
7
- rspec/rspec-expectations#239. Jon Rowe developed a reasonable heuristic
8
- (left side, right side, empty string literal) to avoid this bug.
9
- https://github.com/rspec/rspec-expectations/pull/238
10
- https://github.com/rspec/rspec-expectations/pull/239
11
- * There is a known issue with Rubinius in 1.9 mode reported in
12
- rubinius/rubinius#2268 and demonstrated in the Travis CI builds. For all
13
- other tested platforms, diff-lcs is considered stable. As soon as a suitably
14
- small test-case can be created for the Rubinius team to examine, this will be
15
- added to the Rubinius issue around this.
16
- https://github.com/rubinius/rubinius/issues/2268
17
- https://travis-ci.org/halostatue/diff-lcs/jobs/6241195
18
-
19
- == 1.2.2 / 2013-03-30
20
-
21
- * Bugs Fixed:
22
- * Diff::LCS::Hunk could not properly generate a difference for comparison
23
- sets that are not US-ASCII-compatible because of the use of literal regular
24
- expressions and strings. Jon Rowe (JonRowe) found this in
25
- rspec/rspec-expectations#219 and provided a first pass implementation in
26
- diff-lcs#15. I've reworked it because of test failures in Rubinius when
27
- running in Ruby 1.9 mode. This coerces the added values to the encoding of
28
- the old dataset (as determined by the first piece of the old dataset).
29
- https://github.com/rspec/rspec-expectations/issues/219
30
- https://github.com/halostatue/diff-lcs/pull/15
31
- * Adding Travis CI testing for Ruby 2.0.
32
-
33
- == 1.2.1 / 2013-02-09
34
-
35
- * Bugs Fixed:
36
- * As seen in https://github.com/rspec/rspec-expectations/pull/200, the
37
- release of Diff::LCS 1.2 introduced an unnecessary public API change to
38
- Diff::LCS::Hunk (see the change at
39
- https://github.com/rspec/rspec-expectations/commit/3d6fc82c for details).
40
- The new method name (and behaviour) is more correct, but I should not have
41
- renamed the function or should have at least provided an alias. This
42
- release restores Diff::LCS::Hunk#unshift as an alias to
43
- #merge. Note that the old #unshift behaviour was incorrect and will not be
44
- restored.
45
-
46
- == 1.2.0 / 2013-01-21
47
- * Minor Enhancements:
48
- * Added special case handling for Diff::LCS.patch so that it handles patches
49
- that are empty or contain no changes.
50
- * Added two new methods (#patch\_me and #unpatch\_me) to the includable
51
- module.
52
- * Bugs Fixed:
53
- * Fixed issue #1 patch direction detection.
54
- https://github.com/halostatue/diff-lcs/issues/1
55
- * Resolved issue #2 by handling string[string.size, 1] properly (it returns
56
- "" not nil). https://github.com/halostatue/diff-lcs/issues/2
57
- * Michael Granger (ged) fixed an implementation error in Diff::LCS::Change
58
- and added specs in pull request #8. Thanks!
59
- https://github.com/halostatue/diff-lcs/issues/8
60
- * Made the code auto-testable.
61
- * Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
62
- pull request #10. Thanks! https://github.com/halostatue/diff-lcs/issues/10
63
- * Fixed a documentation issue with the includable versions of #patch! and
64
- #unpatch! where they implied that they would replace the original value.
65
- Given that Diff::LCS.patch always returns a copy, the documentation was
66
- incorrect and has been corrected. To provide the behaviour that was
67
- originally documented, two new methods were added to provide this
68
- behaviour. Found by scooter-dangle in issue #12. Thanks!
69
- https://github.com/halostatue/diff-lcs/issues/12
70
- * Code Style Changes:
71
- * Removed trailing spaces.
72
- * Calling class methods using '.' instead of '::'.
73
- * Vít Ondruch (voxik) removed unnecessary shebangs in pull request #9.
74
- Thanks! https://github.com/halostatue/diff-lcs/issues/9
75
- * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
76
- lucky pull request #13. https://github.com/halostatue/diff-lcs/issues/13
77
- Thanks!
78
- * Embarked on a major refactoring to make the files a little more manageable
79
- and understand the code on a deeper level.
80
- * Adding to http://travis-ci.org.
81
-
82
- == 1.1.3 / 2011-08-27
83
- * Converted to 'hoe' for release.
84
- * Converted tests to RSpec 2.
85
- * Extracted the body of htmldiff into a class available from
86
- diff/lcs/htmldiff.
87
- * Migrated development and issue tracking to GitHub.
88
- * Bugs fixed:
89
- - Eliminated the explicit use of RubyGems in both bin/htmldiff and bin/ldiff.
90
- Resolves issue 4 (https://github.com/halostatue/diff-lcs/issues/4).
91
- - Eliminated Ruby warnings. Resolves issue 3
92
- (https://github.com/halostatue/diff-lcs/issues/3).
93
-
94
- == 1.1.2 / 2004-10-20
95
- * Fixed a problem reported by Mauricio Fernandez in htmldiff.
96
-
97
- == 1.1.1 / 2004-09-25
98
- * Fixed bug #891:
99
- http://rubyforge.org/tracker/?func=detail&atid=407&aid=891&group_id=84
100
- * Fixed a problem with callback initialisation code (it assumed that all
101
- callbacks passed as classes can be initialised; now, it rescues
102
- NoMethodError in the event of private :new being called).
103
- * Modified the non-initialisable callbacks to have a private #new method.
104
- * Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
105
-
106
- == 1.1.0 / -
107
- * Eliminated the need for Diff::LCS::Event and removed it.
108
- * Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
109
- * Implemented patching/unpatching for standard Diff callback output formats
110
- with both #diff and #sdiff.
111
- * Extensive documentation changes.
112
-
113
- == 1.0.4 / -
114
- * Fixed a problem with bin/ldiff output, especially for unified format.
115
- Newlines that should have been present weren't.
116
- * Changed the .tar.gz installer to generate Windows batch files if ones do not
117
- exist already. Removed the existing batch files as they didn't work.
118
-
119
- == 1.0.3 / -
120
- * Fixed a problem with #traverse\_sequences where the first difference from the
121
- left sequence might not be appropriately captured.
122
-
123
- == 1.0.2 / -
124
- * Fixed an issue with ldiff not working because actions were changed from
125
- symbols to strings.
126
-
127
- == 1.0.1 / -
128
- * Minor modifications to the gemspec, the README.
129
- * Renamed the diff program to ldiff (as well as the companion batch file) so as
130
- to not collide with the standard diff program.
131
- * Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
132
- latest CVS version.
133
-
134
- == 1.0 / -
135
- * Initial release based mostly on Perl's Algorithm::Diff.
@@ -1,63 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = "diff-lcs"
5
- s.version = "1.2.1"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Austin Ziegler"]
9
- s.date = "2013-02-09"
10
- s.description = "Diff::LCS computes the difference between two Enumerable sequences using the\nMcIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities\nto create a simple HTML diff output format and a standard diff-like tool.\n\nThis is release 1.2.1, restoring the public API to what existed in Diff::LCS\n1.1.x. Everyone is strongly encouraged to upgrade to this version as it fixes\nall known outstanding issues."
11
- s.email = ["austin@rubyforge.org"]
12
- s.executables = ["htmldiff", "ldiff"]
13
- s.extra_rdoc_files = ["Contributing.rdoc", "History.rdoc", "License.rdoc", "Manifest.txt", "README.rdoc", "docs/COPYING.txt", "docs/artistic.txt", "Contributing.rdoc", "History.rdoc", "License.rdoc", "README.rdoc"]
14
- s.files = [".autotest", ".gemtest", ".rspec", ".travis.yml", "Contributing.rdoc", "Gemfile", "History.rdoc", "License.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "autotest/discover.rb", "bin/htmldiff", "bin/ldiff", "diff-lcs.gemspec", "docs/COPYING.txt", "docs/artistic.txt", "lib/diff-lcs.rb", "lib/diff/lcs.rb", "lib/diff/lcs/array.rb", "lib/diff/lcs/block.rb", "lib/diff/lcs/callbacks.rb", "lib/diff/lcs/change.rb", "lib/diff/lcs/htmldiff.rb", "lib/diff/lcs/hunk.rb", "lib/diff/lcs/internals.rb", "lib/diff/lcs/ldiff.rb", "lib/diff/lcs/string.rb", "spec/change_spec.rb", "spec/diff_spec.rb", "spec/issues_spec.rb", "spec/lcs_spec.rb", "spec/patch_spec.rb", "spec/sdiff_spec.rb", "spec/spec_helper.rb", "spec/traverse_balanced_spec.rb", "spec/traverse_sequences_spec.rb"]
15
- s.homepage = "http://diff-lcs.rubyforge.org/"
16
- s.rdoc_options = ["--main", "README.rdoc"]
17
- s.require_paths = ["lib"]
18
- s.rubyforge_project = "diff-lcs"
19
- s.rubygems_version = "1.8.25"
20
- s.summary = "Diff::LCS computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm"
21
-
22
- if s.respond_to? :specification_version then
23
- s.specification_version = 3
24
-
25
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
- s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
27
- s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
28
- s.add_development_dependency(%q<hoe-bundler>, ["~> 1.2"])
29
- s.add_development_dependency(%q<hoe-doofus>, ["~> 1.0"])
30
- s.add_development_dependency(%q<hoe-gemspec>, ["~> 1.0"])
31
- s.add_development_dependency(%q<hoe-git>, ["~> 1.5"])
32
- s.add_development_dependency(%q<hoe-rubygems>, ["~> 1.0"])
33
- s.add_development_dependency(%q<hoe-travis>, ["~> 1.2"])
34
- s.add_development_dependency(%q<rake>, ["~> 10.0"])
35
- s.add_development_dependency(%q<rspec>, ["~> 2.0"])
36
- s.add_development_dependency(%q<hoe>, ["~> 3.5"])
37
- else
38
- s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
39
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
40
- s.add_dependency(%q<hoe-bundler>, ["~> 1.2"])
41
- s.add_dependency(%q<hoe-doofus>, ["~> 1.0"])
42
- s.add_dependency(%q<hoe-gemspec>, ["~> 1.0"])
43
- s.add_dependency(%q<hoe-git>, ["~> 1.5"])
44
- s.add_dependency(%q<hoe-rubygems>, ["~> 1.0"])
45
- s.add_dependency(%q<hoe-travis>, ["~> 1.2"])
46
- s.add_dependency(%q<rake>, ["~> 10.0"])
47
- s.add_dependency(%q<rspec>, ["~> 2.0"])
48
- s.add_dependency(%q<hoe>, ["~> 3.5"])
49
- end
50
- else
51
- s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
52
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
53
- s.add_dependency(%q<hoe-bundler>, ["~> 1.2"])
54
- s.add_dependency(%q<hoe-doofus>, ["~> 1.0"])
55
- s.add_dependency(%q<hoe-gemspec>, ["~> 1.0"])
56
- s.add_dependency(%q<hoe-git>, ["~> 1.5"])
57
- s.add_dependency(%q<hoe-rubygems>, ["~> 1.0"])
58
- s.add_dependency(%q<hoe-travis>, ["~> 1.2"])
59
- s.add_dependency(%q<rake>, ["~> 10.0"])
60
- s.add_dependency(%q<rspec>, ["~> 2.0"])
61
- s.add_dependency(%q<hoe>, ["~> 3.5"])
62
- end
63
- end
metadata.gz.sig DELETED
Binary file