syntax_tree_ext 0.8.2 → 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 +8 -0
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree_ext/version.rb +1 -1
- data/lib/syntax_tree_ext.rb +19 -0
- metadata +3 -3
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,5 +1,13 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.9.1 (2024-07-17)
|
4
|
+
|
5
|
+
* Add `fullname` to `ModuleDeclaration` and `ClassDeclaration`
|
6
|
+
|
7
|
+
## 0.9.0 (2024-07-16)
|
8
|
+
|
9
|
+
* Require `syntax_tree_ext/parent_node_ext` back
|
10
|
+
|
3
11
|
## 0.8.2 (2024-04-18)
|
4
12
|
|
5
13
|
* Remove `hash_assoc` and `hash_value` methods
|
data/Gemfile.lock
CHANGED
data/lib/syntax_tree_ext.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative "syntax_tree_ext/version"
|
|
4
4
|
|
5
5
|
require 'syntax_tree'
|
6
6
|
require_relative "syntax_tree_ext/source_ext"
|
7
|
+
require_relative "syntax_tree_ext/parent_node_ext"
|
7
8
|
|
8
9
|
module SyntaxTreeExt
|
9
10
|
class Error < StandardError; end
|
@@ -11,6 +12,16 @@ module SyntaxTreeExt
|
|
11
12
|
end
|
12
13
|
|
13
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
|
+
|
14
25
|
module HashNodeExt
|
15
26
|
def keys
|
16
27
|
assocs.map(&:key)
|
@@ -67,6 +78,14 @@ module SyntaxTree
|
|
67
78
|
include HashNodeExt
|
68
79
|
end
|
69
80
|
|
81
|
+
class ClassDeclaration
|
82
|
+
include FullnameExt
|
83
|
+
end
|
84
|
+
|
85
|
+
class ModuleDeclaration
|
86
|
+
include FullnameExt
|
87
|
+
end
|
88
|
+
|
70
89
|
class Node
|
71
90
|
def to_value
|
72
91
|
case self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_tree_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: syntax_tree
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
65
|
requirements: []
|
66
|
-
rubygems_version: 3.5.
|
66
|
+
rubygems_version: 3.5.14
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: extend syntax_tree
|