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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cc69b097951aa19906db6c6467bd29322074e88050b7841b0dffa77efa14a77
4
- data.tar.gz: 0d5189900486cd8727328b4b8bbd1613cba14f14b066098fa78234579a62f529
3
+ metadata.gz: eb89f3eb0b2a887256c35d7ec1cfcfe2277d017eec7a7c941b684dbde4514d8f
4
+ data.tar.gz: 12ed0394b6c1dfc666082b31f7240b23ee193b744ef613caceecfe6fc6ceb231
5
5
  SHA512:
6
- metadata.gz: 2aa74bdaf66a7a32b4a41e2d62fbbb0363d290b1c228becd25664708b0757c5be3ed5b3cf3c8092602dd75f12699b0c2238719c2ddf95804a4e5fbd722a73a35
7
- data.tar.gz: 38c625e90fde3ce91bab147f925598382b08af68d207d2da691ead3d5eca4825cc713cfb307a6eb38a73b62c86375642dad35778e7dbbb0a929cc22c47c2cad1
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
- * require `prism_ext/parent_node_ext` back
13
+ * Require `prism_ext/parent_node_ext` back
6
14
 
7
15
  ## 0.3.8 (2024-07-06)
8
16
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prism_ext (0.4.0)
4
+ prism_ext (0.4.2)
5
5
  prism
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrismExt
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
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.0
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-16 00:00:00.000000000 Z
11
+ date: 2024-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prism