rubbr 1.1.0 → 1.1.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.
- data/History.txt +4 -0
- data/lib/rubbr.rb +5 -1
- data/lib/rubbr/cli.rb +7 -3
- data/lib/rubbr/options.rb +1 -0
- metadata +2 -2
data/History.txt
CHANGED
data/lib/rubbr.rb
CHANGED
@@ -2,7 +2,7 @@ require 'optparse'
|
|
2
2
|
$:.unshift File.dirname(__FILE__)
|
3
3
|
|
4
4
|
module Rubbr
|
5
|
-
VERSION = '1.1.
|
5
|
+
VERSION = '1.1.1'
|
6
6
|
|
7
7
|
autoload :Options, 'rubbr/options'
|
8
8
|
autoload :Cli, 'rubbr/cli'
|
@@ -53,6 +53,10 @@ module Rubbr
|
|
53
53
|
@@cmd_opts[:verboser] = true
|
54
54
|
end
|
55
55
|
|
56
|
+
opts.on('-c', '--color', 'Enable colorized feedback') do
|
57
|
+
@@cmd_opts[:color] = true
|
58
|
+
end
|
59
|
+
|
56
60
|
opts.on('-h', '--help', 'Show this help message') do
|
57
61
|
puts opts
|
58
62
|
exit 1
|
data/lib/rubbr/cli.rb
CHANGED
@@ -3,15 +3,19 @@ module Rubbr
|
|
3
3
|
# Handles command line output and input.
|
4
4
|
module Cli
|
5
5
|
def notice(message)
|
6
|
-
puts message if Rubbr.options[:verbose]
|
6
|
+
puts color?(message, "\e[32m") if Rubbr.options[:verbose]
|
7
7
|
end
|
8
8
|
|
9
9
|
def warning(message)
|
10
|
-
puts " - #{message}" if Rubbr.options[:verbose]
|
10
|
+
puts color?(" - #{message}", "\e[33m") if Rubbr.options[:verbose]
|
11
11
|
end
|
12
12
|
|
13
13
|
def error(message)
|
14
|
-
puts " * #{message}"
|
14
|
+
puts color?(" * #{message}", "\e[31m")
|
15
|
+
end
|
16
|
+
|
17
|
+
def color?(msg, code)
|
18
|
+
Rubbr.options[:color] ? "#{code}#{msg}" : msg
|
15
19
|
end
|
16
20
|
|
17
21
|
def disable_stdout
|
data/lib/rubbr/options.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubbr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eivind Uggedal
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-04-
|
12
|
+
date: 2008-04-07 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|