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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa8f692ed7fc2de3d5ca552114668315b4acdfbb6c687b6e3f9b7f4060d08369
4
- data.tar.gz: eec8c71a43c1deaf8f966d49f57d7ec5c343416ac59e63a2cb722cbd615e9195
3
+ metadata.gz: 94cf1c0bce41162c264343f6d729c42e3bf52e2c6fdc3ea94fa89db6a94c65cc
4
+ data.tar.gz: 80603cadb4661cc660986b896133e5564f67d363eda25d183080bc851a5fc0bb
5
5
  SHA512:
6
- metadata.gz: beb2c4113b482b0fc856fb6c0a05876d3e60c333192ff9169322aed6510ee97c1cc79ed09e7b6400314813fa26b09231fbf65ceded2b0fd026c60b2dc3c62ca7
7
- data.tar.gz: f87a62e94109658d2b28ff7690836d0d141009c5908c17e428f03a9bb3515053ab622b63089de3b4506c569a8197e43f95675209d0cbdd9a2b251a2fc8048c13
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree_ext (0.8.2)
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.8.2"
4
+ VERSION = "0.9.1"
5
5
  end
@@ -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.8.2
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-04-18 00:00:00.000000000 Z
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.3
66
+ rubygems_version: 3.5.14
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: extend syntax_tree