devex 0.3.6 → 0.3.7
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/devex/builtins/lint.rb +24 -0
- data/lib/devex/version.rb +1 -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: 706b385515967e798d258c20f07925a64d65fc023dcf11a9bbb95cbe7daaa896
|
|
4
|
+
data.tar.gz: '06242720010835019af12d6a732778600d4ac82dc04957a9fbaa7b4e6e051fb7'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 266a7d54b5005b3276fcfe7c259ae8799a721550ec3b79e949fbdbfef0a326fb2ec0ffe49d6a86399c9aa45ebb66a752cfde065985997ce4e3fb33e4ead02ad6
|
|
7
|
+
data.tar.gz: 9e004411ef987e6eb20b14d6e7436b518598923e44dc9c74427223cd70d947b6a5919b37d3dd8e7f80647191ecd85c371342ba1704a7c66ffd62decfd5aac500
|
data/lib/devex/builtins/lint.rb
CHANGED
|
@@ -71,6 +71,8 @@ def run_rubocop_bundled
|
|
|
71
71
|
warn " Create .rubocop.yml to customize conventions."
|
|
72
72
|
warn ""
|
|
73
73
|
|
|
74
|
+
check_bundled_config_dependencies
|
|
75
|
+
|
|
74
76
|
args = ["rubocop", "--config", bundled_config.to_s]
|
|
75
77
|
args << "-a" if fix && !unsafe
|
|
76
78
|
args << "-A" if unsafe
|
|
@@ -97,3 +99,25 @@ def changed_files
|
|
|
97
99
|
.select { |f| f.end_with?(".rb") }
|
|
98
100
|
.select { |f| (prj.root / f).exist? }
|
|
99
101
|
end
|
|
102
|
+
|
|
103
|
+
def check_bundled_config_dependencies
|
|
104
|
+
missing = []
|
|
105
|
+
missing << "rubocop-minitest" unless gem_available?("rubocop-minitest")
|
|
106
|
+
missing << "rubocop-tablecop" unless gem_available?("rubocop-tablecop")
|
|
107
|
+
|
|
108
|
+
return if missing.empty?
|
|
109
|
+
|
|
110
|
+
warn "WARNING: Bundled config requires gems not in your Gemfile:"
|
|
111
|
+
missing.each { |gem| warn " - #{gem}" }
|
|
112
|
+
warn ""
|
|
113
|
+
warn "Add to your Gemfile:"
|
|
114
|
+
missing.each { |gem| warn " gem \"#{gem}\"" }
|
|
115
|
+
warn ""
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def gem_available?(name)
|
|
119
|
+
Gem::Specification.find_by_name(name)
|
|
120
|
+
true
|
|
121
|
+
rescue Gem::MissingSpecError
|
|
122
|
+
false
|
|
123
|
+
end
|
data/lib/devex/version.rb
CHANGED