diff-lcs 1.2.4 → 1.4.2

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 (54) 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 +263 -0
  6. data/{License.rdoc → License.md} +0 -0
  7. data/Manifest.txt +15 -8
  8. data/README.rdoc +20 -22
  9. data/Rakefile +23 -22
  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 +67 -52
  22. data/lib/diff/lcs/internals.rb +43 -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 +24 -20
  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 +91 -17
  38. data/spec/lcs_spec.rb +24 -22
  39. data/spec/ldiff_spec.rb +80 -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 +89 -180
  46. data.tar.gz.sig +0 -3
  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 -20
  53. data/History.rdoc +0 -146
  54. metadata.gz.sig +0 -0
data.tar.gz.sig DELETED
@@ -1,3 +0,0 @@
1
- K�T�*V׻���Gݢ�p�οy�M��b�#�����ܝt��ᮣsE-zZ�o7�=5���+����[Ŭ:�Ӿ�F��w��Ϯ��-� f�߁S8�0�s��Ku� �o2*���H�V]�$F}+�
2
- =��s��J?��
3
- �{��,F��m�=����=��كڀb���2{dm��ɌBf_���&�t
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\/|\.gemspec$/
@@ -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,20 +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
-
8
- gem "rubyforge", ">=2.0.4", :group => [:development, :test]
9
- gem "rdoc", "~>4.0", :group => [:development, :test]
10
- gem "hoe-bundler", "~>1.2", :group => [:development, :test]
11
- gem "hoe-doofus", "~>1.0", :group => [:development, :test]
12
- gem "hoe-gemspec2", "~>1.1", :group => [:development, :test]
13
- gem "hoe-git", "~>1.5", :group => [:development, :test]
14
- gem "hoe-rubygems", "~>1.0", :group => [:development, :test]
15
- gem "hoe-travis", "~>1.2", :group => [:development, :test]
16
- gem "rake", "~>10.0", :group => [:development, :test]
17
- gem "rspec", "~>2.0", :group => [:development, :test]
18
- gem "hoe", "~>3.6", :group => [:development, :test]
19
-
20
- # vim: syntax=ruby
@@ -1,146 +0,0 @@
1
- === 1.2.4 / 2013-04-20
2
-
3
- * Bugs fixed:
4
- * A bug was introduced after 1.1.3 when pruning common sequences at the start
5
- of comparison. Paul Kunysch (@pck) fixed this in pull request 18. Thanks!
6
- https://github.com/halostatue/diff-lcs/pull/18
7
- * The Rubinius (1.9 mode) bug in rubinius/rubinius#2268 has been fixed by the
8
- Rubinius team two days after it was filed. Thanks for fixing this so quickly!
9
- https://github.com/rubinius/rubinius/issues/2268
10
- * Switching to Raggi's hoe-gemspec2 for gemspec generation.
11
-
12
- == 1.2.3 / 2013-04-11
13
-
14
- * Bugs Fixed:
15
- * The new encoding detection for diff output generation (added in 1.2.2)
16
- introduced a bug if the left side of the comparison was the empty set.
17
- Originally found in rspec/rspec-expectations#238 and
18
- rspec/rspec-expectations#239. Jon Rowe developed a reasonable heuristic
19
- (left side, right side, empty string literal) to avoid this bug.
20
- https://github.com/rspec/rspec-expectations/pull/238
21
- https://github.com/rspec/rspec-expectations/pull/239
22
- * There is a known issue with Rubinius in 1.9 mode reported in
23
- rubinius/rubinius#2268 and demonstrated in the Travis CI builds. For all
24
- other tested platforms, diff-lcs is considered stable. As soon as a suitably
25
- small test-case can be created for the Rubinius team to examine, this will be
26
- added to the Rubinius issue around this.
27
- https://github.com/rubinius/rubinius/issues/2268
28
- https://travis-ci.org/halostatue/diff-lcs/jobs/6241195
29
-
30
- == 1.2.2 / 2013-03-30
31
-
32
- * Bugs Fixed:
33
- * Diff::LCS::Hunk could not properly generate a difference for comparison
34
- sets that are not US-ASCII-compatible because of the use of literal regular
35
- expressions and strings. Jon Rowe (JonRowe) found this in
36
- rspec/rspec-expectations#219 and provided a first pass implementation in
37
- diff-lcs#15. I've reworked it because of test failures in Rubinius when
38
- running in Ruby 1.9 mode. This coerces the added values to the encoding of
39
- the old dataset (as determined by the first piece of the old dataset).
40
- https://github.com/rspec/rspec-expectations/issues/219
41
- https://github.com/halostatue/diff-lcs/pull/15
42
- * Adding Travis CI testing for Ruby 2.0.
43
-
44
- == 1.2.1 / 2013-02-09
45
-
46
- * Bugs Fixed:
47
- * As seen in https://github.com/rspec/rspec-expectations/pull/200, the
48
- release of Diff::LCS 1.2 introduced an unnecessary public API change to
49
- Diff::LCS::Hunk (see the change at
50
- https://github.com/rspec/rspec-expectations/commit/3d6fc82c for details).
51
- The new method name (and behaviour) is more correct, but I should not have
52
- renamed the function or should have at least provided an alias. This
53
- release restores Diff::LCS::Hunk#unshift as an alias to
54
- #merge. Note that the old #unshift behaviour was incorrect and will not be
55
- restored.
56
-
57
- == 1.2.0 / 2013-01-21
58
- * Minor Enhancements:
59
- * Added special case handling for Diff::LCS.patch so that it handles patches
60
- that are empty or contain no changes.
61
- * Added two new methods (#patch\_me and #unpatch\_me) to the includable
62
- module.
63
- * Bugs Fixed:
64
- * Fixed issue #1 patch direction detection.
65
- https://github.com/halostatue/diff-lcs/issues/1
66
- * Resolved issue #2 by handling string[string.size, 1] properly (it returns
67
- "" not nil). https://github.com/halostatue/diff-lcs/issues/2
68
- * Michael Granger (ged) fixed an implementation error in Diff::LCS::Change
69
- and added specs in pull request #8. Thanks!
70
- https://github.com/halostatue/diff-lcs/issues/8
71
- * Made the code auto-testable.
72
- * Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
73
- pull request #10. Thanks! https://github.com/halostatue/diff-lcs/issues/10
74
- * Fixed a documentation issue with the includable versions of #patch! and
75
- #unpatch! where they implied that they would replace the original value.
76
- Given that Diff::LCS.patch always returns a copy, the documentation was
77
- incorrect and has been corrected. To provide the behaviour that was
78
- originally documented, two new methods were added to provide this
79
- behaviour. Found by scooter-dangle in issue #12. Thanks!
80
- https://github.com/halostatue/diff-lcs/issues/12
81
- * Code Style Changes:
82
- * Removed trailing spaces.
83
- * Calling class methods using '.' instead of '::'.
84
- * Vít Ondruch (voxik) removed unnecessary shebangs in pull request #9.
85
- Thanks! https://github.com/halostatue/diff-lcs/issues/9
86
- * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
87
- lucky pull request #13. https://github.com/halostatue/diff-lcs/issues/13
88
- Thanks!
89
- * Embarked on a major refactoring to make the files a little more manageable
90
- and understand the code on a deeper level.
91
- * Adding to http://travis-ci.org.
92
-
93
- == 1.1.3 / 2011-08-27
94
- * Converted to 'hoe' for release.
95
- * Converted tests to RSpec 2.
96
- * Extracted the body of htmldiff into a class available from
97
- diff/lcs/htmldiff.
98
- * Migrated development and issue tracking to GitHub.
99
- * Bugs fixed:
100
- - Eliminated the explicit use of RubyGems in both bin/htmldiff and bin/ldiff.
101
- Resolves issue 4 (https://github.com/halostatue/diff-lcs/issues/4).
102
- - Eliminated Ruby warnings. Resolves issue 3
103
- (https://github.com/halostatue/diff-lcs/issues/3).
104
-
105
- == 1.1.2 / 2004-10-20
106
- * Fixed a problem reported by Mauricio Fernandez in htmldiff.
107
-
108
- == 1.1.1 / 2004-09-25
109
- * Fixed bug #891:
110
- http://rubyforge.org/tracker/?func=detail&atid=407&aid=891&group_id=84
111
- * Fixed a problem with callback initialisation code (it assumed that all
112
- callbacks passed as classes can be initialised; now, it rescues
113
- NoMethodError in the event of private :new being called).
114
- * Modified the non-initialisable callbacks to have a private #new method.
115
- * Moved ldiff core code to Diff::LCS::Ldiff (diff/lcs/ldiff.rb).
116
-
117
- == 1.1.0 / -
118
- * Eliminated the need for Diff::LCS::Event and removed it.
119
- * Added a contextual diff callback, Diff::LCS::ContextDiffCallback.
120
- * Implemented patching/unpatching for standard Diff callback output formats
121
- with both #diff and #sdiff.
122
- * Extensive documentation changes.
123
-
124
- == 1.0.4 / -
125
- * Fixed a problem with bin/ldiff output, especially for unified format.
126
- Newlines that should have been present weren't.
127
- * Changed the .tar.gz installer to generate Windows batch files if ones do not
128
- exist already. Removed the existing batch files as they didn't work.
129
-
130
- == 1.0.3 / -
131
- * Fixed a problem with #traverse\_sequences where the first difference from the
132
- left sequence might not be appropriately captured.
133
-
134
- == 1.0.2 / -
135
- * Fixed an issue with ldiff not working because actions were changed from
136
- symbols to strings.
137
-
138
- == 1.0.1 / -
139
- * Minor modifications to the gemspec, the README.
140
- * Renamed the diff program to ldiff (as well as the companion batch file) so as
141
- to not collide with the standard diff program.
142
- * Fixed issues with RubyGems. Requires RubyGems > 0.6.1 or >= 0.6.1 with the
143
- latest CVS version.
144
-
145
- == 1.0 / -
146
- * Initial release based mostly on Perl's Algorithm::Diff.
metadata.gz.sig DELETED
Binary file