parser_node_ext 1.3.2 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +3 -3
- data/lib/parser_node_ext/version.rb +1 -1
- data/lib/parser_node_ext.rb +12 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9abeb78d465d5e90a8cd5d921d8cf4e18ccbab4b4cb55997fb49bea0255125a0
|
4
|
+
data.tar.gz: c084ba2e63f1575d8167aac4a970966a0ef0d7ce9b8da2e19dc5ce360d16ee27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d30a4c0ef68c37ab8232dbadacabc4d28099395bbebb3b54e3de6f2c0697de5fff91ba83ec81fc9ba14b98bd4226c59f1da1a1dff3349c39e2e5bc6bce5ca732
|
7
|
+
data.tar.gz: f6f7b429dafe2547a302efd8b58dbdb65cc8700de0b09b3373e30efb5042358db1ceabfde5334237d18c8ad630cf11f879862c9c55e212556bf33ce9461b5b0f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
parser_node_ext (1.
|
4
|
+
parser_node_ext (1.4.1)
|
5
5
|
parser
|
6
6
|
|
7
7
|
GEM
|
@@ -9,10 +9,10 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
ast (2.4.2)
|
11
11
|
diff-lcs (1.5.0)
|
12
|
-
parser (3.3.0
|
12
|
+
parser (3.3.4.0)
|
13
13
|
ast (~> 2.4.1)
|
14
14
|
racc
|
15
|
-
racc (1.
|
15
|
+
racc (1.8.0)
|
16
16
|
rake (13.0.6)
|
17
17
|
rspec (3.11.0)
|
18
18
|
rspec-core (~> 3.11.0)
|
data/lib/parser_node_ext.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative "parser_node_ext/version"
|
4
4
|
|
5
5
|
require 'parser'
|
6
|
+
require_relative "parser_node_ext/parent_node_ext"
|
6
7
|
|
7
8
|
module ParserNodeExt
|
8
9
|
class MethodNotSupported < StandardError; end
|
@@ -129,6 +130,16 @@ module ParserNodeExt
|
|
129
130
|
end
|
130
131
|
end
|
131
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
|
+
|
132
143
|
# Get arguments of node.
|
133
144
|
# It supports :block, :csend, :def, :defined?, :defs, :send, :yeild nodes.
|
134
145
|
# @example
|
@@ -138,7 +149,7 @@ module ParserNodeExt
|
|
138
149
|
# @raise [MethodNotSupported] if calls on other node.
|
139
150
|
def arguments
|
140
151
|
case type
|
141
|
-
when :def
|
152
|
+
when :def
|
142
153
|
children[1].type == :args ? children[1].children : [children[1]]
|
143
154
|
when :defs
|
144
155
|
children[2].type == :args ? children[2].children : [children[2]]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parser_node_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.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-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -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.
|
66
|
+
rubygems_version: 3.5.14
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: extend parser node
|