spaghetti_stack 0.2.0 → 0.2.1

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: 5c893953db35b9bd965993b40cad8befd618a9329e3cafa0bdcbaf990c88e6ba
4
- data.tar.gz: 872836fda20352bcfc92ff438efb4f93d80bc2c91262353193748ebb5c2c254d
3
+ metadata.gz: 494b92ee39864728a47a2a70513efa999801566d309fdff54465398c8c4703b0
4
+ data.tar.gz: 6dd8ab252a53367092c059030a968eec271fda0e682d77d275b677f0f88179af
5
5
  SHA512:
6
- metadata.gz: 21f2083c79d4692a1b48bd3926cda07057e76dec5b33546c3203a48b02e2c47498ebf898700dc735375881ee3004417aa23d308f75d05e0c3ed9f4760de0a01a
7
- data.tar.gz: b748b65925fd16c8f1b56c06377fa4c9e5f3f48fc49d77d72a68fd293ae4f7391f3c05ef37a1da54929f2b46d79973246ddb28d458f4f0e52a8f58e6d27a399c
6
+ metadata.gz: 1d874a020559c073164b9d02560a050c85258aa476c38f18c864983eb9a31de36a2ea7821a20078ce80c2b7847e228c54526141c35994599bc7227ca4c978416
7
+ data.tar.gz: 1c79c6b8eef769161ef44cadfb595279f2e7dbda0acf4ad46b4dc66f134d5afe9031a7835dafe6584e338c62f45a5f1fad0c83f773282d8443ef8a0ae171cca8
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # SpaghettiStack
2
2
 
3
3
  This is a Ruby implementation of a [SpaghettiStack](https://en.wikipedia.org/wiki/Parent_pointer_tree)(also called *parent pointer tree* or *cactus stack*). A SpaghettiStack can be thought as a linked list where each element (call nodes) keeps a reference pointing to their parent (possibly null), but not to their children. This means that a node can only access to it's parent, but not it's children.
4
- Another particularity of this kind of stack is that when nodes are popped, they're kept in-memory instead of being destroyed, thus preserving the link to their parent. That's why this data structure is used by compilers to create symbol tables for each lexical scopes, because it allows them to revisit previous scopes one scope at the time to resolve references.
4
+ Another particularity of this kind of stack is that when nodes are popped, they're kept in-memory instead of being destroyed, thus preserving the link to their parent. That's why this data structure is used by compilers to create symbol tables for each lexical scopes, because it allows them to revisit previous scopes to resolve references.
5
5
  ## Installation
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'spaghetti_stack'
10
+ gem 'spaghetti_stack', '~> 0.1.2'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -13,7 +13,7 @@ class SpaghettiStack
13
13
  end
14
14
 
15
15
  def update(data)
16
- return self if data == @data
16
+ return @data if @data.frozen?
17
17
  @data = data
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SpaghettiStack
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaghetti_stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mansakondo