fasterer 0.1.2 → 0.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfd66e68a652e1bb32201285f8bd465013378659
|
4
|
+
data.tar.gz: a43b21900f515191b7350462c7c6bfc5a200dd89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c446f66a2ccb22546145c0f8a7641dfcd6f5ade08e13b70018ff6a99fdc26fcc7e06c03ae5ed4a98e7668a9acdda03270b6c80d7e8a8153eabac1f191d05903c
|
7
|
+
data.tar.gz: a0f3aecf7322e4636b7999ddfab352a0651b5d110389655348889c3fd7b355542564adb94581f826e2f4527ddf29387b0122e2857f8cec49aa58f7858a5e9a99
|
@@ -47,10 +47,14 @@ module Fasterer
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def check_gsub_offense
|
50
|
-
first_argument
|
51
|
-
|
50
|
+
first_argument = method_call.arguments[0]
|
51
|
+
second_argument = method_call.arguments[1]
|
52
|
+
|
53
|
+
return if first_argument.nil? || second_argument.nil?
|
54
|
+
|
55
|
+
if first_argument.value.is_a?(String) && first_argument.value.size == 1 &&
|
56
|
+
second_argument.value.is_a?(String) && second_argument.value.size == 1
|
52
57
|
|
53
|
-
if first_argument.value.is_a?(String) && first_argument.value.size == 1
|
54
58
|
add_offense(:gsub_vs_tr)
|
55
59
|
end
|
56
60
|
end
|
data/lib/fasterer/version.rb
CHANGED