parser_node_ext 1.4.0 → 1.4.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: 22a93ba0be1ba11d2ad229213f3d23cdced0a9ddcd7c0bfc7ca5554477309f1a
4
- data.tar.gz: f7ee7d6199fbf215e4edc131f05bf6f8029e830a4aba46f41d9003fd4dd34639
3
+ metadata.gz: 9abeb78d465d5e90a8cd5d921d8cf4e18ccbab4b4cb55997fb49bea0255125a0
4
+ data.tar.gz: c084ba2e63f1575d8167aac4a970966a0ef0d7ce9b8da2e19dc5ce360d16ee27
5
5
  SHA512:
6
- metadata.gz: 6ed6775dcbf7b3da276c8bbaf7d10be7da230d3ad46ea92aa9f25f7b150f4b73fb4b2fe8db0c53f6354db6ff6cb58494817907074dec159152cf54fcbb9a5e17
7
- data.tar.gz: 625449de48bc393ae3eec749d6a1c3753161deb2224742962b588e6ae128f50f1f0b68619f95e356c89c9f0ac647a68e083eea0334d8bba6e5ac6be2bbbc5c4e
6
+ metadata.gz: d30a4c0ef68c37ab8232dbadacabc4d28099395bbebb3b54e3de6f2c0697de5fff91ba83ec81fc9ba14b98bd4226c59f1da1a1dff3349c39e2e5bc6bce5ca732
7
+ data.tar.gz: f6f7b429dafe2547a302efd8b58dbdb65cc8700de0b09b3373e30efb5042358db1ceabfde5334237d18c8ad630cf11f879862c9c55e212556bf33ce9461b5b0f
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.4.1 (2024-07-17)
4
+
5
+ * Add `fullname` to `module` and `class`
6
+
3
7
  ## 1.4.0 (2024-07-16)
4
8
 
5
- * require `parser_node_ext/parent_node_ext` back
9
+ * Require `parser_node_ext/parent_node_ext` back
6
10
 
7
11
  ## 1.3.2 (2024-04-18)
8
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parser_node_ext (1.4.0)
4
+ parser_node_ext (1.4.1)
5
5
  parser
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ParserNodeExt
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
@@ -130,6 +130,16 @@ module ParserNodeExt
130
130
  end
131
131
  end
132
132
 
133
+ def fullname
134
+ if %i[class module].include?(type)
135
+ if parent&.respond_to?(:fullname)
136
+ "#{parent.fullname}::#{name.to_source}"
137
+ else
138
+ name.to_source
139
+ end
140
+ end
141
+ end
142
+
133
143
  # Get arguments of node.
134
144
  # It supports :block, :csend, :def, :defined?, :defs, :send, :yeild nodes.
135
145
  # @example
@@ -139,7 +149,7 @@ module ParserNodeExt
139
149
  # @raise [MethodNotSupported] if calls on other node.
140
150
  def arguments
141
151
  case type
142
- when :def, :block
152
+ when :def
143
153
  children[1].type == :args ? children[1].children : [children[1]]
144
154
  when :defs
145
155
  children[2].type == :args ? children[2].children : [children[2]]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parser_node_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang