rubocop-ast 0.4.0 → 0.4.2

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: a691b22abba3de79be3aca5f66247b20b5bdd8fe0bcbe1403d5455c4da25fae9
4
- data.tar.gz: d0984b47a3d0f683447361683acb58afa4fcfffb1597bed575cce1d34fafd90e
3
+ metadata.gz: 40c38e6b0706f9e32534f937c63364ea14265677769db826355eb0b7e54e23fb
4
+ data.tar.gz: 1ea90e49f444e46fdbb998c5689fb711fda71ab6762462358210d8ee1e0494af
5
5
  SHA512:
6
- metadata.gz: 165cfc53926eecd29099f29554dae5e751bb1bee7c4fc42f49abe93db18ea3dbf6589b7b57e6e16aaabf7e842ea253dd41609ab2af343c44db4181af4c815c79
7
- data.tar.gz: f150ffa3ae23ae80f4e3572a529fd19d42509e025e013c02c52eb408c60f3feaf55ef1d53304c19586ad2bf3b3b0ca7aac18503bc45b56ed3ad534dc875d894f
6
+ metadata.gz: cea177a8e7e1a8ee9435fd00788f7ffec664e8b0de29c8fc390ccbbcb211aab5fc834ffdb84d6b05a94075f9d2e6c31aadeb8e43a91e0e5c7f1a8726da186c64
7
+ data.tar.gz: 8b7e38a8f92d84b22bfeac82efb5352d318a8663aecd97c1b9519fb065f6327136a19ce504ba7a75b9b3839ec1ac846c45ec52d414fdd292eebcf615db3ae79d
@@ -28,6 +28,8 @@ module RuboCop
28
28
 
29
29
  # @return [Boolean] if the constant starts with `::` (aka s(:cbase))
30
30
  def absolute?
31
+ return false unless namespace
32
+
31
33
  each_path.first.cbase_type?
32
34
  end
33
35
 
@@ -269,7 +269,8 @@ module RuboCop
269
269
  # is passed as a method argument. In this case tokens are interleaved by
270
270
  # heredoc contents' tokens.
271
271
  def sorted_tokens
272
- @sorted_tokens ||= tokens.sort_by(&:begin_pos)
272
+ # Use stable sort.
273
+ @sorted_tokens ||= tokens.sort_by.with_index { |token, i| [token.begin_pos, i] }
273
274
  end
274
275
 
275
276
  def source_range(range_or_node)
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module AST
5
5
  module Version
6
- STRING = '0.4.0'
6
+ STRING = '0.4.2'
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: 0.4.0
4
+ version: 0.4.2
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-09-11 00:00:00.000000000 Z
13
+ date: 2020-09-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: parser