rubosquad 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubosquad.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4122eef7f956af0412b99e4bb2f220ce2afc33a810b77ec2280244eba9e61ec
|
|
4
|
+
data.tar.gz: dd98295ce280108341cfd86deb9f85a97298011517a1879a7a17fc1f8b634470
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6f8fdca8ada9f7020a7f2544f15ef1c5ec61ba3bc085033b42820c2cba27c1a9c7fa015ca2f8aea156f7e22894542995573155f981757e815ca5fb69b3ed61d
|
|
7
|
+
data.tar.gz: a46e355706bd10b40498712bf2c80f1179e9be08fb804dff81f76391c1a6311092a94325f751fbc6ca7555c9fce78a2167be6ab7e1148714485cc6b3afad07fc
|
data/lib/rubosquad.rb
CHANGED
|
@@ -132,10 +132,18 @@ module Rubosquad
|
|
|
132
132
|
def build_rubocop_cmd(options, extensions, files)
|
|
133
133
|
flag = options[:unsafe_auto_correct] ? '-A' : '-a'
|
|
134
134
|
cmd = ['rubocop', flag, '--format', 'offenses', '--format', 'simple']
|
|
135
|
-
|
|
135
|
+
load_flag = rubocop_supports_plugin_flag? ? '--plugin' : '--require'
|
|
136
|
+
extensions.each { |ext| cmd.push(load_flag, ext) }
|
|
136
137
|
cmd.concat(files)
|
|
137
138
|
end
|
|
138
139
|
|
|
140
|
+
def rubocop_supports_plugin_flag?
|
|
141
|
+
spec = Gem::Specification.find_by_name('rubocop')
|
|
142
|
+
spec.version >= Gem::Version.new('1.72.0')
|
|
143
|
+
rescue Gem::LoadError
|
|
144
|
+
false
|
|
145
|
+
end
|
|
146
|
+
|
|
139
147
|
def format_output(stdout)
|
|
140
148
|
lines = []
|
|
141
149
|
seen_files = Set.new
|