summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin.ziegler@clearfit.com>2013-11-07 15:50:00 -0500
committerAustin Ziegler <austin.ziegler@clearfit.com>2013-11-07 15:50:16 -0500
commit704bc2c0000b5f9bf49d607dcd0d3989b63b2595 (patch)
tree11025740ba349fac80e4207a656aa49639cbc274
parent9479a43bc701f07a78dedcc6e9c34e2cdaad2cc4 (diff)
downloaddiff-lcs-704bc2c0000b5f9bf49d607dcd0d3989b63b2595.tar.gz
Release 1.25: Bugfix for pull request #23.
-rw-r--r--History.rdoc6
-rw-r--r--diff-lcs.gemspec15
-rw-r--r--lib/diff/lcs.rb4
-rw-r--r--spec/sdiff_spec.rb12
4 files changed, 28 insertions, 9 deletions
diff --git a/History.rdoc b/History.rdoc
index 29d394d..27ce620 100644
--- a/History.rdoc
+++ b/History.rdoc
@@ -1,3 +1,9 @@
+== 1.2.5 / 2013-11-07
+
+* Bugs fixed:
+ * Comparing arrays flattened them too far, especially with Diff::LCS.sdiff.
+ https://github.com/halostatue/diff-lcs/pull/23
+
== 1.2.4 / 2013-04-20
* Bugs fixed:
diff --git a/diff-lcs.gemspec b/diff-lcs.gemspec
index 2c18b9e..530d81f 100644
--- a/diff-lcs.gemspec
+++ b/diff-lcs.gemspec
@@ -2,25 +2,26 @@
Gem::Specification.new do |s|
s.name = "diff-lcs"
- s.version = "1.2.4"
+ s.version = "1.2.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Austin Ziegler"]
- s.date = "2013-04-21"
+ s.date = "2013-11-07"
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.4, fixing a bug introduced after diff-lcs 1.1.3 that did\nnot properly prune common sequences at the beginning of a comparison set.\nThanks to Paul Kunysch for fixing this issue.\n\nCoincident with the release of diff-lcs 1.2.3, we reported an issue with\nRubinius in 1.9 mode\n({rubinius/rubinius#2268}[https://github.com/rubinius/rubinius/issues/2268]).\nWe are happy to report that this issue has been resolved."
s.email = ["austin@rubyforge.org"]
s.executables = ["htmldiff", "ldiff"]
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"]
s.files = [".autotest", ".gemtest", ".hoerc", ".rspec", ".travis.yml", "Contributing.rdoc", "Gemfile", "History.rdoc", "License.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "autotest/discover.rb", "bin/htmldiff", "bin/ldiff", "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/hunk_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"]
s.homepage = "http://diff-lcs.rubyforge.org/"
+ s.licenses = ["MIT"]
s.rdoc_options = ["--main", "README.rdoc"]
s.require_paths = ["lib"]
s.rubyforge_project = "diff-lcs"
- s.rubygems_version = "1.8.25"
+ s.rubygems_version = "2.0.7"
s.summary = "Diff::LCS computes the difference between two Enumerable sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm"
if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.specification_version = 4
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<rubyforge>, [">= 2.0.4"])
@@ -33,7 +34,7 @@ Gem::Specification.new do |s|
s.add_development_dependency(%q<hoe-travis>, ["~> 1.2"])
s.add_development_dependency(%q<rake>, ["~> 10.0"])
s.add_development_dependency(%q<rspec>, ["~> 2.0"])
- s.add_development_dependency(%q<hoe>, ["~> 3.6"])
+ s.add_development_dependency(%q<hoe>, ["~> 3.7"])
else
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
s.add_dependency(%q<rdoc>, ["~> 4.0"])
@@ -45,7 +46,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<hoe-travis>, ["~> 1.2"])
s.add_dependency(%q<rake>, ["~> 10.0"])
s.add_dependency(%q<rspec>, ["~> 2.0"])
- s.add_dependency(%q<hoe>, ["~> 3.6"])
+ s.add_dependency(%q<hoe>, ["~> 3.7"])
end
else
s.add_dependency(%q<rubyforge>, [">= 2.0.4"])
@@ -58,6 +59,6 @@ Gem::Specification.new do |s|
s.add_dependency(%q<hoe-travis>, ["~> 1.2"])
s.add_dependency(%q<rake>, ["~> 10.0"])
s.add_dependency(%q<rspec>, ["~> 2.0"])
- s.add_dependency(%q<hoe>, ["~> 3.6"])
+ s.add_dependency(%q<hoe>, ["~> 3.7"])
end
end
diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb
index fcc5cc5..5559615 100644
--- a/lib/diff/lcs.rb
+++ b/lib/diff/lcs.rb
@@ -1,7 +1,7 @@
# -*- ruby encoding: utf-8 -*-
module Diff; end unless defined? Diff
-# = Diff::LCS 1.2.4
+# = Diff::LCS 1.2.5
#
# Computes "intelligent" differences between two sequenced Enumerables. This
# is an implementation of the McIlroy-Hunt "diff" algorithm for Enumerable
@@ -129,7 +129,7 @@ module Diff; end unless defined? Diff
# Common Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May
# 1977, with a few minor improvements to improve the speed."
module Diff::LCS
- VERSION = '1.2.4'
+ VERSION = '1.2.5'
end
require 'diff/lcs/callbacks'
diff --git a/spec/sdiff_spec.rb b/spec/sdiff_spec.rb
index c72206b..7ab3bb6 100644
--- a/spec/sdiff_spec.rb
+++ b/spec/sdiff_spec.rb
@@ -199,4 +199,16 @@ describe "Diff::LCS.sdiff" do
it_has_behavior "compare sequences correctly"
end
+
+ describe "using [[1,2]] & []" do
+ let(:s1) { [ [ 1, 2 ] ] }
+ let(:s2) { [] }
+ let(:result) {
+ [
+ [ '-', [ 0, [ 1, 2 ] ], [ 0, nil ] ]
+ ]
+ }
+
+ it_has_behavior "compare sequences correctly"
+ end
end