mattknox-repl 0.0.2 → 0.0.3

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 (2) hide show
  1. data/lib/repl.rb +3 -6
  2. metadata +1 -1
data/lib/repl.rb CHANGED
@@ -1,18 +1,15 @@
1
- REPL_CONTEXT_STACK = []
2
1
  DEFAULT_STARTING_SELF = self
3
- REPL_LAST_UP = false
2
+ REPL_CONTEXT_STACK = [self]
4
3
 
5
4
  module Repl
6
5
  def repl
7
- REPL_LAST_UP = true
8
6
  DEFAULT_STARTING_SELF.cb self
9
7
  REPL_CONTEXT_STACK.push(self)
10
8
  end
11
9
 
12
10
  def stop_repl
13
- REPL_CONTEXT_STACK.pop if REPL_LAST_UP
14
- REPL_LAST_UP = false
15
- DEFAULT_STARTING_SELF.cb ( REPL_CONTEXT_STACK.empty? ? DEFAULT_STARTING_SELF : REPL_CONTEXT_STACK.pop )
11
+ REPL_CONTEXT_STACK.pop if (self == REPL_CONTEXT_STACK.last)
12
+ DEFAULT_STARTING_SELF.cb( REPL_CONTEXT_STACK.empty? ? DEFAULT_STARTING_SELF : REPL_CONTEXT_STACK.pop )
16
13
  end
17
14
  end
18
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mattknox-repl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - matt knox