Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add support for diff-lcs 1.2.x while maintaining backwards compatibility with 1.1.3 #200

Merged
merged 1 commit into from

2 participants

@petergoldstein

diff-lcs 1.2.0 has recently been released, and all users have been encouraged to upgrade. rspec-expectations has a gemspec which specifies ~> 1.1.3, which makes this upgrade impossible for rspec users.

There is an API incompatibility (basically a method name change) between the two diff-lcs versions that materially affects rspec-expectations, although the underlying functionality is essentially unchanged. So I added a respond_to? call to determine if the diff-lcs gem is 1.2.x or 1.1.3, and which calls the appropriate method for the library version.

This is a very limited change, although there's no easy way to test the gem's compatibility against both versions of diff-lcs as part of the specs.

@petergoldstein petergoldstein Add support for diff-lcs 1.2.x while maintaining backwards compatibil…
…ity with diff-lcs 1.1.3. Updated gemspec to support either as a runtime dependency.
feba881
@myronmarston myronmarston merged commit 3d6fc82 into rspec:master
@myronmarston

Thanks!

@jperkin jperkin referenced this pull request from a commit in joyent/pkgsrc
taca Update ruby-diff-lcs to 1.2.1.
== 1.2.1 / 2013-02-09

* Bugs Fixed:
  * As seen in rspec/rspec-expectations#200, the
    release of Diff::LCS 1.2 introduced an unnecessary public API change to
    Diff::LCS::Hunk (see the change at
    rspec/rspec-expectations@3d6fc82 for details).
    The new method name (and behaviour) is more correct, but I should not have
    renamed the function or should have at least provided an alias. This
    release restores Diff::LCS::Hunk#unshift as an alias to
    #merge. Note that the old #unshift behaviour was incorrect and will not be
    restored.

== 1.2.0 / 2013-01-21
* Minor Enhancements:
  * Added special case handling for Diff::LCS.patch so that it handles patches
    that are empty or contain no changes.
  * Added two new methods (#patch\_me and #unpatch\_me) to the includable
    module.
* Bugs Fixed:
  * Fixed issue #1 patch direction detection.
    halostatue/diff-lcs#1
  * Resolved issue #2 by handling string[string.size, 1] properly (it returns
    "" not nil). halostatue/diff-lcs#2
  * Michael Granger (ged) fixed an implementation error in Diff::LCS::Change
    and added specs in pull request #8. Thanks!
    halostatue/diff-lcs#8
  * Made the code auto-testable.
  * Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
    pull request #10. Thanks! halostatue/diff-lcs#10
  * Fixed a documentation issue with the includable versions of #patch! and
    #unpatch! where they implied that they would replace the original value.
    Given that Diff::LCS.patch always returns a copy, the documentation was
    incorrect and has been corrected. To provide the behaviour that was
    originally documented, two new methods were added to provide this
    behaviour. Found by scooter-dangle in issue #12. Thanks!
    halostatue/diff-lcs#12
* Code Style Changes:
  * Removed trailing spaces.
  * Calling class methods using '.' instead of '::'.
  * Vít Ondruch (voxik) removed unnecessary shebangs in pull request #9.
    Thanks! halostatue/diff-lcs#9
  * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
    lucky pull request #13. halostatue/diff-lcs#13
    Thanks!
  * Embarked on a major refactoring to make the files a little more manageable
    and understand the code on a deeper level.
  * Adding to http://travis-ci.org.
235b6e1
@jperkin jperkin referenced this pull request from a commit in joyent/pkgsrc
taca Update ruby-diff-lcs to 1.2.1.
== 1.2.1 / 2013-02-09

* Bugs Fixed:
  * As seen in rspec/rspec-expectations#200, the
    release of Diff::LCS 1.2 introduced an unnecessary public API change to
    Diff::LCS::Hunk (see the change at
    rspec/rspec-expectations@3d6fc82 for details).
    The new method name (and behaviour) is more correct, but I should not have
    renamed the function or should have at least provided an alias. This
    release restores Diff::LCS::Hunk#unshift as an alias to
    #merge. Note that the old #unshift behaviour was incorrect and will not be
    restored.

== 1.2.0 / 2013-01-21
* Minor Enhancements:
  * Added special case handling for Diff::LCS.patch so that it handles patches
    that are empty or contain no changes.
  * Added two new methods (#patch\_me and #unpatch\_me) to the includable
    module.
* Bugs Fixed:
  * Fixed issue #1 patch direction detection.
    halostatue/diff-lcs#1
  * Resolved issue #2 by handling string[string.size, 1] properly (it returns
    "" not nil). halostatue/diff-lcs#2
  * Michael Granger (ged) fixed an implementation error in Diff::LCS::Change
    and added specs in pull request #8. Thanks!
    halostatue/diff-lcs#8
  * Made the code auto-testable.
  * Vít Ondruch (voxik) provided the latest version of the GPL2 license file in
    pull request #10. Thanks! halostatue/diff-lcs#10
  * Fixed a documentation issue with the includable versions of #patch! and
    #unpatch! where they implied that they would replace the original value.
    Given that Diff::LCS.patch always returns a copy, the documentation was
    incorrect and has been corrected. To provide the behaviour that was
    originally documented, two new methods were added to provide this
    behaviour. Found by scooter-dangle in issue #12. Thanks!
    halostatue/diff-lcs#12
* Code Style Changes:
  * Removed trailing spaces.
  * Calling class methods using '.' instead of '::'.
  * Vít Ondruch (voxik) removed unnecessary shebangs in pull request #9.
    Thanks! halostatue/diff-lcs#9
  * Kenichi Kamiya (kachick) removed some warnings of an unused variable in
    lucky pull request #13. halostatue/diff-lcs#13
    Thanks!
  * Embarked on a major refactoring to make the files a little more manageable
    and understand the code on a deeper level.
  * Adding to http://travis-ci.org.
d5c805b
@shin-szk-engineering shin-szk-engineering referenced this pull request from a commit in szk-engineering/loremipsum
@shin-szk-engineering shin-szk-engineering