rubocop-ast 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 +4 -4
- data/lib/rubocop/ast.rb +1 -0
- data/lib/rubocop/ast/builder.rb +1 -1
- data/lib/rubocop/ast/node/dstr_node.rb +16 -0
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 514cdc7bddc33ed7ef5123a27b9a8c7f4977a6d5f79b677371e8ec9b0f8641c3
|
4
|
+
data.tar.gz: 66670e0fa5cf3e0710154714eb854624a592d72d219aee0e425e11be009892ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc1dc3353b12e90a8166d02d7ddf95e80a966290c6f611500cc5b446a707456a6acbd15947d92399b3ddd004195e8c8da4b23dd3ca80c91226920dd269326621
|
7
|
+
data.tar.gz: 962af11aa6ad1d1b32117758661faa0e43f632cf6540df082e2e0aedabfecd7fb98adc9b30ff4ee5beb63674b2ad42a3dcc7b07a821e109e77b49868efce8b69
|
data/lib/rubocop/ast.rb
CHANGED
@@ -72,6 +72,7 @@ require_relative 'ast/node/return_node'
|
|
72
72
|
require_relative 'ast/node/self_class_node'
|
73
73
|
require_relative 'ast/node/send_node'
|
74
74
|
require_relative 'ast/node/str_node'
|
75
|
+
require_relative 'ast/node/dstr_node'
|
75
76
|
require_relative 'ast/node/super_node'
|
76
77
|
require_relative 'ast/node/symbol_node'
|
77
78
|
require_relative 'ast/node/until_node'
|
data/lib/rubocop/ast/builder.rb
CHANGED
@@ -42,6 +42,7 @@ module RuboCop
|
|
42
42
|
def: DefNode,
|
43
43
|
defined?: DefinedNode,
|
44
44
|
defs: DefNode,
|
45
|
+
dstr: DstrNode,
|
45
46
|
ensure: EnsureNode,
|
46
47
|
for: ForNode,
|
47
48
|
forward_args: ForwardArgsNode,
|
@@ -68,7 +69,6 @@ module RuboCop
|
|
68
69
|
csend: SendNode,
|
69
70
|
send: SendNode,
|
70
71
|
str: StrNode,
|
71
|
-
dstr: StrNode,
|
72
72
|
xstr: StrNode,
|
73
73
|
sclass: SelfClassNode,
|
74
74
|
super: SuperNode,
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module AST
|
5
|
+
# A node extension for `dstr` nodes. This will be used
|
6
|
+
# in place of a plain node when the builder constructs the AST, making
|
7
|
+
# its methods available to all `dstr` nodes within RuboCop.
|
8
|
+
class DstrNode < StrNode
|
9
|
+
def value
|
10
|
+
child_nodes.map do |child|
|
11
|
+
child.respond_to?(:value) ? child.value : child.source
|
12
|
+
end.join
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/rubocop/ast/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-01-
|
13
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/rubocop/ast/node/const_node.rb
|
77
77
|
- lib/rubocop/ast/node/def_node.rb
|
78
78
|
- lib/rubocop/ast/node/defined_node.rb
|
79
|
+
- lib/rubocop/ast/node/dstr_node.rb
|
79
80
|
- lib/rubocop/ast/node/ensure_node.rb
|
80
81
|
- lib/rubocop/ast/node/float_node.rb
|
81
82
|
- lib/rubocop/ast/node/for_node.rb
|