rubbr 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.1.1 / 2008-04-07
2
+
3
+ * Support for colorized cli output.
4
+
1
5
  == 1.1.0 / 2008-04-06
2
6
 
3
7
  * Source files are now compiled only if they've changed since last build.
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.0'
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
@@ -20,6 +20,7 @@ module Rubbr
20
20
  :distribution_name => distribution_name(root_dir),
21
21
  :verbose => false,
22
22
  :verboser => false,
23
+ :color => false,
23
24
  :format => :dvi,
24
25
  :engine => :latex
25
26
  }
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.0
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-06 00:00:00 +02:00
12
+ date: 2008-04-07 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency