prism_ext 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile.lock +1 -1
- data/lib/prism_ext/version.rb +1 -1
- data/lib/prism_ext.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb89f3eb0b2a887256c35d7ec1cfcfe2277d017eec7a7c941b684dbde4514d8f
|
4
|
+
data.tar.gz: 12ed0394b6c1dfc666082b31f7240b23ee193b744ef613caceecfe6fc6ceb231
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd49ffe56ff888abd1f133f3d0863f0d8743668abcafcd8c803eb3a8b3161905d67e7f86d3c9682c6aac93c9bd20d859676231d9ed764b5d3146d74c0efb9e97
|
7
|
+
data.tar.gz: b9c2dd537ad6587ef4884da4274dce25c08ac44bde60b66044e17ed4780cf233cb176de9e835cabdd2c6b2b1efe59c097b8196be942d69d706ed24d528428621
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.4.2 (2024-07-17)
|
4
|
+
|
5
|
+
* Rename `fullname` to `full_name`
|
6
|
+
|
7
|
+
## 0.4.1 (2024-07-17)
|
8
|
+
|
9
|
+
* Add `fullname` to `ModuleNode` and `ClassNode`
|
10
|
+
|
3
11
|
## 0.4.0 (2024-07-16)
|
4
12
|
|
5
|
-
*
|
13
|
+
* Require `prism_ext/parent_node_ext` back
|
6
14
|
|
7
15
|
## 0.3.8 (2024-07-06)
|
8
16
|
|
data/Gemfile.lock
CHANGED
data/lib/prism_ext/version.rb
CHANGED
data/lib/prism_ext.rb
CHANGED
@@ -11,6 +11,16 @@ module PrismExt
|
|
11
11
|
end
|
12
12
|
|
13
13
|
module Prism
|
14
|
+
module FullNameExt
|
15
|
+
def full_name
|
16
|
+
if parent_node&.parent_node&.respond_to?(:full_name)
|
17
|
+
"#{parent_node.parent_node.full_name}::#{constant_path.to_source}"
|
18
|
+
else
|
19
|
+
constant_path.to_source
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
14
24
|
module HashNodeExt
|
15
25
|
def keys
|
16
26
|
elements.select { |element| element.type == :assoc_node }.map(&:key)
|
@@ -60,6 +70,14 @@ module Prism
|
|
60
70
|
include HashNodeExt
|
61
71
|
end
|
62
72
|
|
73
|
+
class ClassNode
|
74
|
+
include FullNameExt
|
75
|
+
end
|
76
|
+
|
77
|
+
class ModuleNode
|
78
|
+
include FullNameExt
|
79
|
+
end
|
80
|
+
|
63
81
|
class Node
|
64
82
|
def to_value
|
65
83
|
case self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prism_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
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-07-
|
11
|
+
date: 2024-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prism
|