syntax_tree_ext 0.9.0 → 0.9.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: 1652ff82c38eae093e5149cee9890481a7785cd02f3abb6b9b96d413afd9c770
4
- data.tar.gz: c20755aeddb8801aa87966642b342f085c25d444fb65d77298681a84393590ef
3
+ metadata.gz: 94cf1c0bce41162c264343f6d729c42e3bf52e2c6fdc3ea94fa89db6a94c65cc
4
+ data.tar.gz: 80603cadb4661cc660986b896133e5564f67d363eda25d183080bc851a5fc0bb
5
5
  SHA512:
6
- metadata.gz: 7546c74ea30c030c3f51a47b98e6446e3bca4e5e55575329eed52090e3151d43f5305e3190208d9fdaeb5d605a9a2abee37e0690d4aaf5525fffd8b1e33a4165
7
- data.tar.gz: a8a4b6837c0c2a4770e6e1a6b51d72dd13c80e52339be8a5aa91a93a0af5c13c5b1d12650d2bdb2e30f586a10603deb0b7c5dbede845167d8c14ddf24d40fdb9
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
- * require `syntax_tree_ext/parent_node_ext` back
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree_ext (0.9.0)
4
+ syntax_tree_ext (0.9.1)
5
5
  syntax_tree
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SyntaxTreeExt
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax_tree_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang