circular_linked 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/LICENSE +21 -0
  4. data/README.md +75 -0
  5. data/circular_linked.gemspec +14 -0
  6. metadata +41 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7eaddc29746a2d99c05aadcf1e490004f23683178dc49afd5293656c3edceded
4
- data.tar.gz: 3c906b3079d972ceadad706bcb3cf93749600c24d3b4ebbad7f91cd19df91555
3
+ metadata.gz: c66e140ce6431483d0dfe4218a2c16f67f014758462096c5211b668cf5d0c055
4
+ data.tar.gz: a2f8dbed96644f69e676bb5502eefc47aa96a6bb05941232b2ecddf9fe93f50a
5
5
  SHA512:
6
- metadata.gz: d583d18873400eec464d1d708aa3b1d4791c1cc38af6b824a2b9f904be4633882b42eaeda58627608159e6da40f58eed5051824c38cc03f34ca6051b187f513b
7
- data.tar.gz: 2034ffcd127a04c5d6b1e4a9fce71580b4caddddf6c92525399fb57e036a8ab931ee4f4e3a72e2e792732894fdfb1578fcbdc6ee707436b4df7d271a08a7344e
6
+ metadata.gz: a67efe860fa5022f93c689f5baa505e85eda6e88d6397a8eeced3fa46b72e3f74dd90aa1e8b86c9a975c042e45d25fce39d93497be927b30cd3f3e41cabb323a
7
+ data.tar.gz: 3ccc92339558d4a19cc797ee1968a1df6946333350153103cad33485e241e40d2c5b8502b7792c2a84bc14367f39353a4059c6c1a335c276bbce15b0fb9b3a6c
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ .gem/
3
+ Gemfile.lock
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Gabriela Matos Guedes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Circular Linked List
2
+
3
+ Implementation for the circular linked list data structure for Ruby.
4
+
5
+ List is composed by nodes, which have each one a value and a next item.
6
+
7
+ ## Installation
8
+
9
+ Just add to your Gemfile:
10
+
11
+ ```
12
+ gem "circular_linked"
13
+ ```
14
+
15
+ Then
16
+
17
+ ```
18
+ $ bundle install
19
+ ```
20
+
21
+ Or you can install the gem directly from terminal:
22
+
23
+ ```
24
+ $ gem install circular_linked
25
+ ```
26
+
27
+ ## Usage
28
+
29
+ ```ruby
30
+ items_list = CircularLinked::List.new(1, 2, 3)
31
+ empty_list = CircularLinked::List.new
32
+
33
+ items_list.head #=> #<Node:0x... @value=1 ...
34
+ empty_list.head #=> nil
35
+
36
+ items_list.add(4) # List now have nodes with the values: 1, 2, 3, 4
37
+
38
+ items_list.last_node #=> 4
39
+ empty_list.last_node #=> nil
40
+
41
+ items_list.find(2) #=> #<Node:0x... @value=2 ...
42
+ empty_list.find(2) #=> nil
43
+
44
+ items_list.remove(3) # List now have nodes with the values: 1, 2, 4
45
+ empty_list.remove(3) # List remains empty
46
+
47
+ items_list.items_value #=> [1,2,4]
48
+ empty_list.items_value #=> []
49
+
50
+ items_list.length #=> 3
51
+ empty_list.length #=> 0
52
+
53
+ items_list.each {|node| puts node.value }
54
+ #=> 1
55
+ #=> 2
56
+ #=> 4
57
+ empty_list.each {|node| puts node.value }
58
+ #=>
59
+ ```
60
+
61
+ ## Development
62
+
63
+ Just run `bundle install` to install the dependencies and you are ready.
64
+
65
+ ## Tests
66
+
67
+ To run the specs, after installing the dependecies as said above, you can just run in the main folder:
68
+
69
+ ```
70
+ $ rspec .
71
+ ```
72
+
73
+ ## Contributing
74
+
75
+ Feel free to open pull requests/issues or to fork this repo.
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'circular_linked'
3
+ s.version = '0.0.2'
4
+ s.summary = 'Circular Linked List implementation'
5
+ s.description = 'Provides a circular linked list data structure for Ruby with the most common methods'
6
+ s.authors = ['Gabriela Guedes']
7
+ s.email = 'gabriela.guedes.gmg@gmail.com'
8
+ s.files = `git ls-files`.split("\n")
9
+ s.homepage = 'https://github.com/GabrielaGuedes/circular_linked'
10
+ s.license = 'MIT'
11
+
12
+ s.add_development_dependency "bundler", '>= 2.0', '< 3.0'
13
+ s.add_development_dependency "rspec", '~> 3.10'
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circular_linked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriela Guedes
@@ -9,7 +9,41 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2021-02-02 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '2.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.10'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '3.10'
13
47
  description: Provides a circular linked list data structure for Ruby with the most
14
48
  common methods
15
49
  email: gabriela.guedes.gmg@gmail.com
@@ -17,14 +51,18 @@ executables: []
17
51
  extensions: []
18
52
  extra_rdoc_files: []
19
53
  files:
54
+ - ".gitignore"
20
55
  - Gemfile
21
56
  - Gemfile.lock
57
+ - LICENSE
58
+ - README.md
59
+ - circular_linked.gemspec
22
60
  - lib/circular_linked.rb
23
61
  - lib/circular_linked/list.rb
24
62
  - lib/circular_linked/node.rb
25
63
  - spec/circular_linked/list_spec.rb
26
64
  - spec/circular_linked/node_spec.rb
27
- homepage:
65
+ homepage: https://github.com/GabrielaGuedes/circular_linked
28
66
  licenses:
29
67
  - MIT
30
68
  metadata: {}