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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80da9c79ffae899ecc1eea266704e35274d85ce07d3f46a9bed2a7ac573445b9
4
- data.tar.gz: af113442d1be42f61c17b369e097c6c0ad9c5c9c49cac27c70dee3c21aa39568
3
+ metadata.gz: ec19a654b5c38c2a70e811bd7c16a86473bd9fec2444774e9d8ef3cfa9d9de58
4
+ data.tar.gz: 6a0ef9e9d121c5ba9991bb7cd534f8e180d84718ef093fc0be8099175bf027b4
5
5
  SHA512:
6
- metadata.gz: d4d26dca602b849000686fa68f1b543681d8e51598741a6a4bf9e69a57ca6bab21ce8ac270b8578ad473808ed985f13ce9b080ac2259ad73fd6f87110e345305
7
- data.tar.gz: 72d5d9852cd5286ba8d01c7f5b46b774fdfb7bae7382aebd9cf766b8bd103f22477d3ba7d47a62c3466bc35d74eba4784e6b53725aa4332669d20a8801d46936
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
- branches = [if_branch]
149
-
150
- return branches unless else?
151
-
152
- other_branches = if elsif_conditional?
153
- else_branch.branches
154
- else
155
- [else_branch]
156
- end
157
- branches.concat(other_branches)
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}"
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '1.1.0'
6
+ STRING = '1.1.1'
7
7
  end
8
8
  end
9
9
  end
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.0
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-10-27 00:00:00.000000000 Z
13
+ date: 2020-11-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser