Run of fresh-releases for ruby-linked-list

Try this locally (using silver-platter):

debian-svp new-upstream ruby-linked-list 

Merge these changes:

git pull https://janitor.debian.net/git/ruby-linked-list fresh-releases/main
git pull https://janitor.debian.net/git/ruby-linked-list fresh-releases/upstream

Summary

Merged new upstream version: 0.0.15 (was: 0.0.14).

Diff

Branch: main

diff --git a/.travis.yml b/.travis.yml
index c6995a8..b5cbdda 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: ruby
 rvm:
-  - 2.6
+  - 2.7
 cache: bundler
 env:
   CI: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cd4d8e..bd86d9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+# 0.0.x / Unreleased
+
+
+# 0.0.15 / 2020-05-26
+
+## Fixed
+
+- Fixed bug when deleting the last node of the list. The @tail value was not updated if the @head value was updated.
+
+[Compare v0.0.14...v0.0.15](https://github.com/spectator/linked-list/compare/v0.0.14...v0.0.15)
+
 # 0.0.14 / 2020-04-17
 
 ## Fixed
diff --git a/debian/changelog b/debian/changelog
index a419045..bc3d704 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,6 @@
+ruby-linked-list (0.0.15-1) UNRELEASED; urgency=low
+ -- Debian Janitor <janitor@jelmer.uk>  Sat, 27 Mar 2021 16:43:47 -0000
+
 ruby-linked-list (0.0.14-2) unstable; urgency=medium
 
   * Source-only upload for migration to testing
diff --git a/lib/linked-list/list.rb b/lib/linked-list/list.rb
index aef0b9e..fd5f8a0 100644
--- a/lib/linked-list/list.rb
+++ b/lib/linked-list/list.rb
@@ -286,19 +286,19 @@ module LinkedList
     private
 
     def __unlink_node(node)
+      @head = node.next if node.prev.nil?
+      @tail = node.prev if node.next.nil?
+
       if node.prev.nil?
         node.next.prev = nil if node.next
-        @head = node.next
       elsif node.next.nil?
         node.prev.next = nil if node.prev
-        @tail = node.prev
       else
         node.prev.next, node.next.prev = node.next, node.prev
       end
       @length -= 1
     end
 
-
     def __to_matcher(val = nil, &block)
       raise ArgumentError, 'either value or block should be passed' if val && block_given?
       block = ->(e) { e == val } unless block_given?
diff --git a/lib/linked-list/version.rb b/lib/linked-list/version.rb
index fb3b3c3..7a2a44e 100644
--- a/lib/linked-list/version.rb
+++ b/lib/linked-list/version.rb
@@ -2,6 +2,6 @@
 
 module Linked
   module List
-    VERSION = '0.0.14'
+    VERSION = '0.0.15'
   end
 end
diff --git a/linked-list.gemspec b/linked-list.gemspec
index 61f3378..4c5144e 100644
--- a/linked-list.gemspec
+++ b/linked-list.gemspec
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
   spec.test_files    = spec.files.grep(%r{^(test|spec|features)/})
   spec.require_paths = ['lib']
 
-  spec.add_development_dependency 'bundler', '>= 1.3', '<= 2.0'
+  spec.add_development_dependency 'bundler', '>= 2.0', '< 3.0'
   spec.add_development_dependency 'coveralls', '~> 0'
   spec.add_development_dependency 'm', '~> 1.5', '>= 1.5.0'
   spec.add_development_dependency 'minitest', '>= 5.0', '<= 6.0'
diff --git a/test/list_test.rb b/test/list_test.rb
index e569265..8b78136 100644
--- a/test/list_test.rb
+++ b/test/list_test.rb
@@ -510,20 +510,39 @@ describe LinkedList::List do
 
         it 'deletes value from head' do
           list.delete(node_1)
-          assert_equal ['bar', 'baz'], list.to_a
-          assert_equal 'bar', list.first
+          assert_equal [node_2.data, node_3.data], list.to_a
+          assert_equal node_2.data, list.first
+          assert_equal node_3.data, list.last
         end
 
         it 'deletes value from middle' do
           list.delete(node_2)
-          assert_equal ['foo', 'baz'], list.to_a
+          assert_equal [node_1.data, node_3.data], list.to_a
+          assert_equal node_1.data, list.first
+          assert_equal node_3.data, list.last
         end
 
 
         it 'deletes value from tail' do
           list.delete(node_3)
-          assert_equal ['foo', 'bar'], list.to_a
-          assert_equal 'bar', list.last
+          assert_equal [node_1.data, node_2.data], list.to_a
+          assert_equal node_1.data, list.first
+          assert_equal node_2.data, list.last
+        end
+      end
+
+      describe 'delete edge cases' do
+        it 'resets original list state when deleting the last node of the list' do
+          assert_nil list.first
+          assert_nil list.last
+
+          list.push(node_1)
+          assert_equal node_1.data, list.first
+          assert_equal node_1.data, list.last
+
+          list.delete(node_1)
+          assert_nil list.first
+          assert_nil list.last
         end
       end
     end

Branch: upstream

Tag: upstream/0.0.15

Diff is too long (more than 200 lines). Download the raw diff.

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.15/lib/linked-list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.15/lib/linked-list/conversions.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.15/lib/linked-list/list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.15/lib/linked-list/node.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.15/lib/linked-list/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/linked-list-0.0.15.gemspec

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.14/lib/linked-list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.14/lib/linked-list/conversions.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.14/lib/linked-list/list.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.14/lib/linked-list/node.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/gems/linked-list-0.0.14/lib/linked-list/version.rb
-rw-r--r--  root/root   /usr/share/rubygems-integration/all/specifications/linked-list-0.0.14.gemspec

No differences were encountered in the control files

Lintian Result

Full worker log Full build log