diff-lcs 1.2.2 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
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 +21 -18
  9. data/Rakefile +35 -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 +1 -1
  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 +54 -45
  37. data/spec/issues_spec.rb +50 -17
  38. data/spec/lcs_spec.rb +24 -22
  39. data/spec/ldiff_spec.rb +72 -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 +100 -169
  46. data.tar.gz.sig +0 -0
  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 -117
  54. data/diff-lcs.gemspec +0 -63
  55. metadata.gz.sig +0 -4
data.tar.gz.sig DELETED
Binary file
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,117 +0,0 @@
1
- == 1.2.2 / 2013-03-30
2
-
3
- * Bugs Fixed:
4
- * Diff::LCS::Hunk could not properly generate a difference for comparison
5
- sets that are not US-ASCII-compatible because of the use of literal regular
6
- expressions and strings. Jon Rowe (JonRowe) found this in
7
- rspec/rspec-expectations#219 and provided a first pass implementation in
8
- diff-lcs#15. I've reworked it because of test failures in Rubinius when
9
- running in Ruby 1.9 mode. This coerces the added values to the encoding of
10
- the old dataset (as determined by the first piece of the old dataset).
11
- https://github.com/rspec/rspec-expectations/issues/219
12
- https://github.com/halostatue/diff-lcs/pull/15
13
- * Adding Travis CI testing for Ruby 2.0.
14
-
15
- == 1.2.1 / 2013-02-09
16
-
17
- * Bugs Fixed:
18
- * As seen in https://github.com/rspec/rspec-expectations/pull/200, the
19
- release of Diff::LCS 1.2 introduced an unnecessary public API change to
20
- Diff::LCS::Hunk (see the change at
21
- https://github.com/rspec/rspec-expectations/commit/3d6fc82c for details).
22
- The new method name (and behaviour) is more correct, but I should not have
23
- renamed the function or should have at least provided an alias. This
24
- release restores Diff::LCS::Hunk#unshift as an alias to
25
- #merge. Note that the old #unshift behaviour was incorrect and will not be
26
- restored.
27
-
28
- == 1.2.0 / 2013-01-21
29
- * Minor Enhancements:
30
- * Added special case handling for Diff::LCS.patch so that it handles patches
31
- that are empty or contain no changes.
32
- * Added two new methods (#patch\_me and #unpatch\_me) to the includable
33
- module.
34
- * Bugs Fixed:
35
- * Fixed issue #1 patch direction detection.
36
- https://github.com/halostatue/diff-lcs/issues/1
37
- * Resolved issue #2 by handling string[string.size, 1] properly (it returns
38
- "" not nil). https://github.com/halostatue/diff-lcs/issues/2
39
- * Michael Granger (ged) fixed an implementation error in Diff::LCS::Change
40
- and added specs in pull request #8. Thanks!
41
- https://github.com/halostatue/diff-lcs/issues/8
42
- * Made the code auto-testable.
43
- * Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
44
- pull request #10. Thanks! https://github.com/halostatue/diff-lcs/issues/10
45
- * Fixed a documentation issue with the includable versions of #patch! and
46
- #unpatch! where they implied that they would replace the original value.
47
- Given that Diff::LCS.patch always returns a copy, the documentation was
48
- incorrect and has been corrected. To provide the behaviour that was
49
- originally documented, two new methods were added to provide this
50
- behaviour. Found by scooter-dangle in issue #12. Thanks!
51
- https://github.com/halostatue/diff-lcs/issues/12
52
- * Code Style Changes:
53
- * Removed trailing spaces.
54
- * Calling class methods using '.' instead of '::'.
55
- * Vít Ondruch (voxik) removed unnecessary shebangs in pull request #9.
56
- Thanks! https://github.com/halostatue/diff-lcs/issues/9
57
- * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
58
- lucky pull request #13. https://github.com/halostatue/diff-lcs/issues/13
59
- Thanks!
60
- * Embarked on a major refactoring to make the files a little more manageable
61
- and understand the code on a deeper level.
62
- * Adding to http://travis-ci.org.
63
-
64
- == 1.1.3 / 2011-08-27
65
- * Converted to 'hoe' for release.
66
- * Converted tests to RSpec 2.
67
- * Extracted the body of htmldiff into a class available from
68
- diff/lcs/htmldiff.
69
- * Migrated development and issue tracking to GitHub.
70
- * Bugs fixed:
71
- - Eliminated the explicit use of RubyGems in both bin/htmldiff and bin/ldiff.
72
- Resolves issue 4 (https://github.com/halostatue/diff-lcs/issues/4).
73
- - Eliminated Ruby warnings. Resolves issue 3
74
- (https://github.com/halostatue/diff-lcs/issues/3).
75
-
76
- == 1.1.2 / 2004-10-20
77
- * Fixed a problem reported by Mauricio Fernandez in htmldiff.
78
-
79
- == 1.1.1 / 2004-09-25
80
- * Fixed bug #891:
81
- http://rubyforge.org/tracker/?func=detail&atid=407&aid=891&group_id=84
82
- * Fixed a problem with callback initialisation code (it assumed that all
83
- callbacks passed as classes can be initialised; now, it rescues
84
- NoMethodError in the event of private :new being called).
85
- * Modified the non-initialisable callbacks to have a private #new method.
86
- * Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
87
-
88
- == 1.1.0 / -
89
- * Eliminated the need for Diff::LCS::Event and removed it.
90
- * Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
91
- * Implemented patching/unpatching for standard Diff callback output formats
92
- with both #diff and #sdiff.
93
- * Extensive documentation changes.
94
-
95
- == 1.0.4 / -
96
- * Fixed a problem with bin/ldiff output, especially for unified format.
97
- Newlines that should have been present weren't.
98
- * Changed the .tar.gz installer to generate Windows batch files if ones do not
99
- exist already. Removed the existing batch files as they didn't work.
100
-
101
- == 1.0.3 / -
102
- * Fixed a problem with #traverse\_sequences where the first difference from the
103
- left sequence might not be appropriately captured.
104
-
105
- == 1.0.2 / -
106
- * Fixed an issue with ldiff not working because actions were changed from
107
- symbols to strings.
108
-
109
- == 1.0.1 / -
110
- * Minor modifications to the gemspec, the README.
111
- * Renamed the diff program to ldiff (as well as the companion batch file) so as
112
- to not collide with the standard diff program.
113
- * Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
114
- latest CVS version.
115
-
116
- == 1.0 / -
117
- * 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
@@ -1,4 +0,0 @@
1
- ���!y$ġHE���0�{k���@��.�F�[�('�-y�����] \~���Y�O�� $���
2
- ���k'4�t��ӕ��K��k��{�Dɂ5�ե�
3
- �1����Kĭ��i7|�8}�6W�B>Jv��"]�hf�zZa�t�\�2�/�L����hЅ�@D�՜
4
- ��;��l��=��G�7 �_a��0��XtN<����d�yq��P