aye_var 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dc57331745963e18275993f2f5e138ceb4ed5e3c430fa8cc7d3cce4b5f7287f
4
- data.tar.gz: 9d757f2b30b255ea2bc1da8710e75076c0becf2e4860a12fd8b0d68e49e81b20
3
+ metadata.gz: 43fa3e277efd2c75c2c45fbb7fdacfef9fd840a3e1e843ae669b5226ae7b4f59
4
+ data.tar.gz: 456a214d767e825c3983977923a9bb2c574ac9712eaada1c0a30f349d4aa752e
5
5
  SHA512:
6
- metadata.gz: 64c64e8430e9433b8cbf14e8315c20ce50983b75ebbf80904f10c061ca5962c4c158082ceecc6807f349c923557f908c2270184625fe31d724627681554e877c
7
- data.tar.gz: 667027a5fe9452fb3893c72780d41543923e20c850794c065318d81cf9e45f1474c9bf17d8c1d4dd2ac142a942c34a98faf8fe147dae47c0b13cf42def29aaf1
6
+ metadata.gz: 07f1cde6759331c4f52c24a5bad9f103a73938cbbe4621f2a2cb3296ecad43b52f288cb7f2c939e6ddf5f4622f31eabd27cbba2a7ad9ff0679218b05db397d94
7
+ data.tar.gz: 5982d8b834e1ccce351d8aad013bbb8687408b5763ef14c403cbe69ca24b7c977006792b19fc7b0e05a73f437a9fc6cbb9be0266e3fb3255d7108c34dd6ff335
data/README.md CHANGED
@@ -23,3 +23,9 @@ AyeVar.init(include: ["#{Dir.pwd}/**/*"])
23
23
  ```
24
24
 
25
25
  Ye can pass an array o’ globs to `include:` an’ `exclude:`, or I’ll feed ye to th’ kraken, ye mangy bilge-suckin’ swab!
26
+
27
+ ## Uninstall
28
+
29
+ By the powers! On account o’ how AyeVar works, ye can cut ’er loose any time without havin’ ta meddle with yer code, ye scurvy dogs! Just cast the gem to Davy Jones’ locker an’ scrub the `AyeVar.init` call from yer charts!
30
+
31
+ If ye be usin’ Bootsnap, ye’ll need ta swab yer Bootsnap cache clean by sendin’ `temp/cache/bootsnap` to the briny deep!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AyeVar
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
data/lib/aye_var.rb CHANGED
@@ -35,7 +35,6 @@ module AyeVar
35
35
  end
36
36
 
37
37
  def initialize
38
- @this = nil
39
38
  @context = Set[]
40
39
  @annotations = []
41
40
  end
@@ -43,31 +42,31 @@ module AyeVar
43
42
  attr_reader :annotations
44
43
 
45
44
  def visit_class_node(node)
46
- new_context(node) { super }
45
+ new_context { super }
47
46
  end
48
47
 
49
48
  def visit_module_node(node)
50
- new_context(node) { super }
49
+ new_context { super }
51
50
  end
52
51
 
53
52
  def visit_block_node(node)
54
- new_context(node) { super }
53
+ new_context { super }
55
54
  end
56
55
 
57
56
  def visit_singleton_class_node(node)
58
- new_context(node) { super }
57
+ new_context { super }
59
58
  end
60
59
 
61
60
  def visit_defined_node(node)
62
61
  if Prism::InstanceVariableReadNode === node.value
63
- context << node.value.name
62
+ @context << node.value.name
64
63
  end
65
64
 
66
65
  super
67
66
  end
68
67
 
69
68
  def visit_def_node(node)
70
- new_context(node) { super }
69
+ new_context { super }
71
70
  end
72
71
 
73
72
  def visit_if_node(node)
@@ -90,10 +89,10 @@ module AyeVar
90
89
  def visit_instance_variable_read_node(node)
91
90
  name = node.name
92
91
 
93
- unless context.include?(name)
92
+ unless @context.include?(name)
94
93
  location = node.location
95
94
 
96
- context << name
95
+ @context << name
97
96
 
98
97
  @annotations << [location.start_character_offset, :start, name]
99
98
  @annotations << [location.end_character_offset, :end, name]
@@ -102,17 +101,14 @@ module AyeVar
102
101
  super
103
102
  end
104
103
 
105
- private def new_context(this)
106
- original_this = @this
104
+ private def new_context
107
105
  original_context = @context
108
106
 
109
- @this = this
110
107
  @context = Set[]
111
108
 
112
109
  begin
113
110
  yield
114
111
  ensure
115
- @this = original_this
116
112
  @context = original_context
117
113
  end
118
114
  end
@@ -127,10 +123,5 @@ module AyeVar
127
123
  @context = original_context
128
124
  end
129
125
  end
130
-
131
- # The current context on the stack
132
- private def context
133
- @context
134
- end
135
126
  end
136
127
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aye_var
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Drapper