rubocop-ast 1.1.0 → 1.1.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/node/if_node.rb +13 -10
- data/lib/rubocop/ast/traversal.rb +4 -4
- data/lib/rubocop/ast/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec19a654b5c38c2a70e811bd7c16a86473bd9fec2444774e9d8ef3cfa9d9de58
|
4
|
+
data.tar.gz: 6a0ef9e9d121c5ba9991bb7cd534f8e180d84718ef093fc0be8099175bf027b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a720f20464156e92dddd9979ae2dff71a7a5deca84b2e8c717b9165fa9e831b4c15c5f7cba3c33cd8986a2618822ee0e82386e58d1586b1ebefbb5a74f9972b6
|
7
|
+
data.tar.gz: bf26e4aa780bf56d029ca9272825a4a91d8c76f87d88e7c43de8167e06d8e2687d2d450e28f989b77c3d61169a0d91866bfe1504f2069aee3d0d2e16e2ce4444
|
@@ -145,16 +145,19 @@ module RuboCop
|
|
145
145
|
#
|
146
146
|
# @return [Array<Node>] an array of branch nodes
|
147
147
|
def branches
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
148
|
+
if ternary?
|
149
|
+
[if_branch, else_branch]
|
150
|
+
elsif !else?
|
151
|
+
[if_branch]
|
152
|
+
else
|
153
|
+
branches = [if_branch]
|
154
|
+
other_branches = if elsif_conditional?
|
155
|
+
else_branch.branches
|
156
|
+
else
|
157
|
+
[else_branch]
|
158
|
+
end
|
159
|
+
branches.concat(other_branches)
|
160
|
+
end
|
158
161
|
end
|
159
162
|
|
160
163
|
# @deprecated Use `branches.each`
|
@@ -39,10 +39,10 @@ module RuboCop
|
|
39
39
|
type, *aliases = type
|
40
40
|
lineno = caller_locations(1, 1).first.lineno
|
41
41
|
module_eval(<<~RUBY, __FILE__, lineno) # rubocop:disable Style/EvalWithLocation
|
42
|
-
def on_#{type}(node)
|
43
|
-
#{body}
|
44
|
-
nil
|
45
|
-
end
|
42
|
+
def on_#{type}(node) # def on_send(node)
|
43
|
+
#{body} # # body ...
|
44
|
+
nil # nil
|
45
|
+
end # end
|
46
46
|
RUBY
|
47
47
|
aliases.each do |m|
|
48
48
|
alias_method "on_#{m}", "on_#{type}"
|
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.1.
|
4
|
+
version: 1.1.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: 2020-
|
13
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parser
|