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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a25c9286abc5741876a8ef140872298234a999ed8b5ff743d180b72f086d124
4
- data.tar.gz: 5c8ea9b619ecc46dd309ef780e4decab5c973bec504ad1b8f9c9fae1a0e86ff2
3
+ metadata.gz: 15598f8e5d0a9e202a5b5a794ce7a41e9745915b3107b553923b51840ad81ff4
4
+ data.tar.gz: 9c5344b6f68e2c5d37eda47d7596d2c6b69e1a6e6d1bf6775526d54f00b5506a
5
5
  SHA512:
6
- metadata.gz: 96fbb5e8171a31ae5d7f9e7b23466ddf20800ff4dfaae0eb96704d2616ec7634282e43e2ebcc854a490b4a6d32cf52bed86a96af6106ce95735ca523742b93fb
7
- data.tar.gz: ce8586a000314bc3e90aa7295c4e415c031b1252911b56242abcd87dc6143a70a77ef6ec77a6f23e78918c2b16270d65cf688d525937b38e804c2b762cb21b6d
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
+ ![Umarell](https://raw.githubusercontent.com/nebulab/umarell/master/assets/umarell.jpg?raw=true "Umarell")
4
6
 
5
7
  ## Installation
6
8
 
@@ -23,13 +23,18 @@ module Umarell
23
23
 
24
24
  # Entry point to start the application
25
25
  def run
26
- parse_options
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
- message = "\n\e[35m[Umarell] Running #{name}...\e[0m"
57
- system "echo '#{message}'; #{command} #{args.join(' ')} #{@target}"
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Umarell
4
4
  module Version
5
- STRING = '1.0.1'
5
+ STRING = '1.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umarell
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filippo Liverani