rubocop-rails 2.1.0 → 2.2.0

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: ca19a40db180cbb867ecc23d7d17847353b83ec36b7bbd0b3c5cc7ab0292be97
4
- data.tar.gz: be277fe9bceb0d47ab049c2d3cbc2f7315b98022053a13cad04e6a46fa887bdc
3
+ metadata.gz: ad71070534d738a411a8cff630f6631592c3f704bddf47d11a014c3721a88cc0
4
+ data.tar.gz: 07646afb945a609a7b6e498d4df6399f85b5c4e54e5f3a91ae27b375e798787d
5
5
  SHA512:
6
- metadata.gz: 97bd6156d36c5e09e82588d636417e30f926f1cb0c68dafcf0b93f0c4a373851613d1ed2200863925f4374c1876d85d14d9fd8b013f45aad092bddefcdf1b243
7
- data.tar.gz: c09d5c7765d0186bcd389cedf6a0b45d0b0a442f173c6489decd17c56767b3ca6d20e2dd35e6610fc4bee2b2e2af657055c4cf87e20312d611b07aeae3ae2d2d
6
+ metadata.gz: 0460ef0f52a504e1c7e49f25542f563697005f57a72d92d3542c63927b6579c23ab1ce38cc5fb501b6ec4a3b60fc057756ee8ec8fb2a169a5fe85c51d87b71c2
7
+ data.tar.gz: 98982bc1c50a9336ea2a51f5911fc2edfaf1630c706998d8c1cd78cac42d51716627a475e2a3fc4ed5d315a290f43bc659c3c72cc6ebebec7eee023931a789a9
@@ -55,8 +55,6 @@ module RuboCop
55
55
  MSG_LOCALTIME = 'Do not use `Time.localtime` without ' \
56
56
  'offset or zone.'
57
57
 
58
- TIMECLASSES = %i[Time DateTime].freeze
59
-
60
58
  GOOD_METHODS = %i[zone zone_default find_zone find_zone!].freeze
61
59
 
62
60
  DANGEROUS_METHODS = %i[now local new parse at current].freeze
@@ -67,10 +65,10 @@ module RuboCop
67
65
  def on_const(node)
68
66
  mod, klass = *node
69
67
  # we should only check core classes
70
- # (`DateTime`, `Time`, `::DateTime` or `::Time`)
68
+ # (`Time` or `::Time`)
71
69
  return unless (mod.nil? || mod.cbase_type?) && method_send?(node)
72
70
 
73
- check_time_node(klass, node.parent) if TIMECLASSES.include?(klass)
71
+ check_time_node(klass, node.parent) if klass == :Time
74
72
  end
75
73
 
76
74
  def autocorrect(node)
@@ -153,7 +151,7 @@ module RuboCop
153
151
  if (receiver.is_a? RuboCop::AST::Node) && !receiver.cbase_type?
154
152
  method_from_time_class?(receiver)
155
153
  else
156
- TIMECLASSES.include?(method_name)
154
+ method_name == :Time
157
155
  end
158
156
  end
159
157
 
@@ -1,13 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module RuboCop
4
- # RuboCop included the Rails cops directly before version 1.0.0.
5
- # We can remove them to avoid warnings about redefining constants.
6
- module Cop
7
- remove_const('Rails') if const_defined?('Rails', false)
8
- end
9
- end
10
-
11
3
  require_relative 'mixin/target_rails_version'
12
4
 
13
5
  require_relative 'rails/action_filter'
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Rails
5
5
  # This module holds the RuboCop Rails version information.
6
6
  module Version
7
- STRING = '2.1.0'
7
+ STRING = '2.2.0'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
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: 2019-06-25 00:00:00.000000000 Z
13
+ date: 2019-07-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack