linked-list 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a70c658176bc2e924764731304a3f8dbb376306e35b9e016d41896a7b5790463
4
- data.tar.gz: cde342c544b41d53f5c52eb3d592deed28a6bf79736b6a0f2dbb1ef2d78319a7
3
+ metadata.gz: dff645cd01380ea68e75dd61a217a9c217a76eb229dc87817caab297444619d7
4
+ data.tar.gz: cbb85a2893c007c17729a3335b9ea9dd65ae9fd6b7f7a83ce4289fa024b21499
5
5
  SHA512:
6
- metadata.gz: db29d3d0ec5195c12937ae63332a8dbb3ac891f6510441762f5a42d1acfce8de826d9a20a6af308e9b39a5fe33fcf92527c26d1ffd757c6814fb2c09ed4c34a4
7
- data.tar.gz: 7723a09dc0858687eaf4ff6668e024ba8b7efd00cc202ab6eb067baffc52f645f6138d286cec946ccb30896b372345f91b601db5e8dee8900c65582ffe61577b
6
+ metadata.gz: 8085a108cc3ac4a8edeea3585a0fd0c8adf1639e450d9d6f33e42b8002c3c1d0bd6a4fd6f88ff8b957075b36ff97bf236ed705446f6536ce029ba59c4f16d867
7
+ data.tar.gz: 44feefe384c7420d01bba47b31c9ebc825097d672250b0c0a5a5f1615e2c031678b086631bfab05180da05a560757146657fcfeac30f360163f6b08cd4c43f49
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # 0.0.x / Unreleased
2
2
 
3
+ # 0.0.16 / 2021-09-21
4
+
5
+ ## Fixed
6
+
7
+ - Fixed bug when reference to prev node was not set correctly аfter using `shift`.
8
+
9
+ [Compare v0.0.15...v0.0.16](https://github.com/spectator/linked-list/compare/v0.0.15...v0.0.16)
3
10
 
4
11
  # 0.0.15 / 2020-05-26
5
12
 
@@ -308,7 +308,7 @@ module LinkedList
308
308
  def __shift
309
309
  head = @head
310
310
  @head = @head.next
311
- head.next = nil
311
+ @head.prev = nil if @head
312
312
  head
313
313
  end
314
314
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Linked
4
4
  module List
5
- VERSION = '0.0.15'
5
+ VERSION = '0.0.16'
6
6
  end
7
7
  end
data/test/list_test.rb CHANGED
@@ -638,6 +638,16 @@ describe LinkedList::List do
638
638
  assert_nil list.first
639
639
  end
640
640
 
641
+ it 'sets reference to the prev node' do
642
+ list.push(node_1)
643
+ list.push(node_2)
644
+ assert_nil node_1.prev
645
+ assert_equal node_2.prev, node_1
646
+
647
+ list.shift
648
+ assert_nil node_2.prev
649
+ end
650
+
641
651
  it 'reduces list length by 1' do
642
652
  list.push(node_1)
643
653
  list.shift
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linked-list
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Velikanau
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -130,7 +130,7 @@ homepage: https://github.com/spectator/linked-list
130
130
  licenses:
131
131
  - MIT
132
132
  metadata: {}
133
- post_install_message:
133
+ post_install_message:
134
134
  rdoc_options: []
135
135
  require_paths:
136
136
  - lib
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  version: '0'
147
147
  requirements: []
148
148
  rubygems_version: 3.1.2
149
- signing_key:
149
+ signing_key:
150
150
  specification_version: 4
151
151
  summary: Ruby implementation of Doubly Linked List, following some Ruby idioms.
152
152
  test_files: