Skip to content

Commit

Permalink
Resolve #35 with a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jul 1, 2020
1 parent 693fc61 commit 66dd8d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions History.md
Expand Up @@ -6,6 +6,8 @@
detection. [#44][]
- Fixed a theoretical issue reported by Jun Aruga in Diff::LCS::Hunk to raise
a more useful exception. [#43][]
- Added documentation that should address custom object issues as reported in
[#35][].
- Fixed more diff errors, in part reported in [#65][].

## 1.4.3 / 2020-06-29
Expand Down Expand Up @@ -271,6 +273,7 @@
[#29]: https://github.com/halostatue/diff-lcs/pull/29
[#33]: https://github.com/halostatue/diff-lcs/issues/33
[#34]: https://github.com/halostatue/diff-lcs/pull/34
[#35]: https://github.com/halostatue/diff-lcs/issues/35
[#36]: https://github.com/halostatue/diff-lcs/pull/36
[#38]: https://github.com/halostatue/diff-lcs/issues/38
[#43]: https://github.com/halostatue/diff-lcs/issues/43
Expand Down
7 changes: 7 additions & 0 deletions lib/diff/lcs.rb
Expand Up @@ -60,6 +60,13 @@ module Diff::LCS # rubocop:disable Style/Documentation
# +self+ and +other+. See Diff::LCS#lcs.
#
# lcs = seq1.lcs(seq2)
#
# A note when using objects: Diff::LCS only works properly when each object
# can be used as a key in a Hash, which typically means that the objects must
# implement Object#eql? in a way that two identical values compare
# identically for key purposes. That is:
#
# O.new('a').eql?(O.new('a')) == true
def lcs(other, &block) #:yields self[i] if there are matched subsequences:
Diff::LCS.lcs(self, other, &block)
end
Expand Down

0 comments on commit 66dd8d9

Please sign in to comment.