syntax_tree_ext 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree_ext/version.rb +1 -1
- data/lib/syntax_tree_ext.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94cf1c0bce41162c264343f6d729c42e3bf52e2c6fdc3ea94fa89db6a94c65cc
|
4
|
+
data.tar.gz: 80603cadb4661cc660986b896133e5564f67d363eda25d183080bc851a5fc0bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a7dee237d8baa6d1253d59f367925e8298641c07404799b32a3018d452993a5448ccfcfa37985de9003ac511591f3303696a16e0c5cc7330f894a43496d73e4
|
7
|
+
data.tar.gz: f90ae48c7303a092454c1be8f6ebed8aa13ef48432bc8f3b4eaa67a4c806dec0c795bc0d92b7a8c49d25089ab4327b271876d81a5cb4106de97e0210647f1275
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.9.1 (2024-07-17)
|
4
|
+
|
5
|
+
* Add `fullname` to `ModuleDeclaration` and `ClassDeclaration`
|
6
|
+
|
3
7
|
## 0.9.0 (2024-07-16)
|
4
8
|
|
5
|
-
*
|
9
|
+
* Require `syntax_tree_ext/parent_node_ext` back
|
6
10
|
|
7
11
|
## 0.8.2 (2024-04-18)
|
8
12
|
|
data/Gemfile.lock
CHANGED
data/lib/syntax_tree_ext.rb
CHANGED
@@ -12,6 +12,16 @@ module SyntaxTreeExt
|
|
12
12
|
end
|
13
13
|
|
14
14
|
module SyntaxTree
|
15
|
+
module FullnameExt
|
16
|
+
def fullname
|
17
|
+
if parent_node&.parent_node&.parent_node&.respond_to?(:fullname)
|
18
|
+
"#{parent_node.parent_node.parent_node.fullname}::#{constant.to_source}"
|
19
|
+
else
|
20
|
+
constant.to_source
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
15
25
|
module HashNodeExt
|
16
26
|
def keys
|
17
27
|
assocs.map(&:key)
|
@@ -68,6 +78,14 @@ module SyntaxTree
|
|
68
78
|
include HashNodeExt
|
69
79
|
end
|
70
80
|
|
81
|
+
class ClassDeclaration
|
82
|
+
include FullnameExt
|
83
|
+
end
|
84
|
+
|
85
|
+
class ModuleDeclaration
|
86
|
+
include FullnameExt
|
87
|
+
end
|
88
|
+
|
71
89
|
class Node
|
72
90
|
def to_value
|
73
91
|
case self
|