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