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 +4 -4
- data/lib/rubocop/cop/rails/time_zone.rb +3 -5
- data/lib/rubocop/cop/rails_cops.rb +0 -8
- data/lib/rubocop/rails/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: ad71070534d738a411a8cff630f6631592c3f704bddf47d11a014c3721a88cc0
|
4
|
+
data.tar.gz: 07646afb945a609a7b6e498d4df6399f85b5c4e54e5f3a91ae27b375e798787d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
# (`
|
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
|
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
|
-
|
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'
|
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.
|
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
|
13
|
+
date: 2019-07-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|