umarell 1.0.1 → 1.1.0
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/README.md +2 -0
- data/lib/umarell/cli.rb +20 -10
- data/lib/umarell/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: 15598f8e5d0a9e202a5b5a794ce7a41e9745915b3107b553923b51840ad81ff4
|
4
|
+
data.tar.gz: 9c5344b6f68e2c5d37eda47d7596d2c6b69e1a6e6d1bf6775526d54f00b5506a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b023bb874fbe2d2f2ff93fbafcda0228194a6a7775402403636694772b7233d3d05bbb054d78a2db609ac73bb011ee65dd5cf3a0d42c966c840eefbe3d4e59b
|
7
|
+
data.tar.gz: a0c021b90036c659de421943fb2f9466ccf0dc38841e15f72a448c84dc50e48c50f063c3468c23e112c63e3003f75f0ac7340de42e3e02acb89e4e5b4d44b225
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Umarell
|
2
2
|
|
3
3
|
Umarell is an all in one Ruby static code analyzer.
|
4
|
+
Umarell gives you (*unwanted?*) advice on your code just like an [italian old man watching a construction site](https://en.wikipedia.org/wiki/Umarell).
|
5
|
+

|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
data/lib/umarell/cli.rb
CHANGED
@@ -23,13 +23,18 @@ module Umarell
|
|
23
23
|
|
24
24
|
# Entry point to start the application
|
25
25
|
def run
|
26
|
-
|
27
|
-
create_args
|
26
|
+
parse_args
|
28
27
|
run_commands
|
29
28
|
end
|
30
29
|
|
31
30
|
private
|
32
31
|
|
32
|
+
def parse_args
|
33
|
+
parse_options
|
34
|
+
@target = ARGV.pop
|
35
|
+
@args[:rubocop] = ['-a'] if @autofix
|
36
|
+
end
|
37
|
+
|
33
38
|
def parse_options
|
34
39
|
OptionParser.new do |opts|
|
35
40
|
opts.banner = 'Usage: umarell [options] [target]'
|
@@ -37,13 +42,11 @@ module Umarell
|
|
37
42
|
opts.on('-a', '--autofix', 'Autofix violations (if supported)') do
|
38
43
|
@autofix = true
|
39
44
|
end
|
45
|
+
opts.on_tail('-v', '--version', 'Show version') do
|
46
|
+
puts Version::STRING
|
47
|
+
exit
|
48
|
+
end
|
40
49
|
end.parse!
|
41
|
-
|
42
|
-
@target = ARGV.pop
|
43
|
-
end
|
44
|
-
|
45
|
-
def create_args
|
46
|
-
@args[:rubocop] = ['-a'] if @autofix
|
47
50
|
end
|
48
51
|
|
49
52
|
def run_commands
|
@@ -53,8 +56,15 @@ module Umarell
|
|
53
56
|
end
|
54
57
|
|
55
58
|
def run_command(name, command, args)
|
56
|
-
|
57
|
-
|
59
|
+
header = decorate_message("Running #{name}")
|
60
|
+
footer = decorate_message("#{name} run complete\n")
|
61
|
+
full_command = "#{command} #{args.join(' ')} #{@target}"
|
62
|
+
|
63
|
+
system "echo '#{header}'; #{full_command}; echo '#{footer}'"
|
64
|
+
end
|
65
|
+
|
66
|
+
def decorate_message(string)
|
67
|
+
"\e[1;94m~~~~~~~ [Umarell] #{string}\e[0m"
|
58
68
|
end
|
59
69
|
end
|
60
70
|
end
|
data/lib/umarell/version.rb
CHANGED