capistrano_colors 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,3 +1,4 @@
1
+ capistrano_colors.gemspec
1
2
  lib/capistrano_colors.rb
2
3
  Manifest
3
4
  Rakefile
data/README.rdoc CHANGED
@@ -5,7 +5,7 @@ When capistrano_colors is included in your deploy.rb capistrano output gets nice
5
5
 
6
6
  == INSTALLATION
7
7
 
8
- sudo gem install stjernstrom-capistrano_colors --source http://gems.github.com
8
+ sudo gem install capistrano_colors
9
9
 
10
10
  == USAGE
11
11
 
@@ -13,6 +13,14 @@ In your config/deploy.rb
13
13
 
14
14
  require 'capistrano_colors'
15
15
 
16
+ == CHANGES
17
+
18
+ v.0.2.1
19
+
20
+ - Bugfix for some err: messages that where not printed in red.
21
+ - Moved console colors to constants
22
+ - Simple cleanup
23
+
16
24
  == AUTHOR
17
25
 
18
26
  Mathias Stjernström (http://pastbedti.me/)
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('capistrano_colors', '0.2.0') do |p|
5
+ Echoe.new('capistrano_colors', '0.2.1') do |p|
6
6
  p.description = "Simple gem to display colors in capistrano output."
7
7
  p.url = "http://github.com/stjernstrom/capistrano_colors"
8
8
  p.author = "Mathias Stjernstrom"
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{capistrano_colors}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mathias Stjernstrom"]
9
- s.date = %q{2008-12-21}
9
+ s.date = %q{2008-12-23}
10
10
  s.description = %q{Simple gem to display colors in capistrano output.}
11
11
  s.email = %q{mathias@globalinn.com}
12
12
  s.extra_rdoc_files = ["lib/capistrano_colors.rb", "README.rdoc"]
13
- s.files = ["lib/capistrano_colors.rb", "Manifest", "Rakefile", "README.rdoc", "capistrano_colors.gemspec"]
13
+ s.files = ["capistrano_colors.gemspec", "lib/capistrano_colors.rb", "Manifest", "Rakefile", "README.rdoc"]
14
14
  s.has_rdoc = true
15
15
  s.homepage = %q{http://github.com/stjernstrom/capistrano_colors}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano_colors", "--main", "README.rdoc"]
@@ -3,33 +3,40 @@ puts "\e[36m == capistrano_colors loaded ==\e[0m"
3
3
  module Capistrano
4
4
  class Logger
5
5
 
6
+ CC_STD = "0"
7
+ CC_RED = "31"
8
+ CC_GREEN = "32"
9
+ CC_YELLOW = "33"
10
+ CC_BLUE = "34"
11
+
6
12
  def colorize(message, color, nl = "\n")
7
13
  "\e[#{color}m" + message.strip + "\e[0m#{nl}"
8
14
  end
9
15
 
10
16
  def debug(message, line_prefix=nil)
11
17
  if message =~ /executing `.*/
12
- # log(DEBUG, colorize("==[task]====================================", "32"), line_prefix)
13
- log(DEBUG, colorize("== Currently " + message, "32"), line_prefix)
14
- # log(DEBUG, colorize("============================================", "32"), line_prefix)
18
+ log(DEBUG, colorize("== Currently " + message, CC_GREEN), line_prefix)
15
19
  else
16
- log(DEBUG, colorize(message, "33"), line_prefix)
20
+ log(DEBUG, colorize(message, CC_YELLOW), line_prefix)
17
21
  end
18
22
  end
19
23
 
20
24
  def info(message, line_prefix=nil)
21
- if message =~ /.*out\] (fatal:|ERROR:).*/
22
- color = "31"
23
- elsif message =~ /Permission denied/
24
- color = "31"
25
+ if message =~ /.*out\] (fatal:|ERROR:).*/ || message =~ /Permission denied/
26
+ color = CC_RED
25
27
  else
26
- color = "0"
28
+ color = CC_STD
27
29
  end
28
30
  log(INFO, colorize(message,color), line_prefix)
29
31
  end
30
32
 
31
33
  def important(message, line_prefix=nil)
32
- log(IMPORTANT, colorize(message, "34"), line_prefix)
34
+ if line_prefix =~ /^err ::/
35
+ color = CC_RED
36
+ else
37
+ color = CC_BLUE
38
+ end
39
+ log(IMPORTANT, colorize(message, color), line_prefix) if !message.strip.empty?
33
40
  end
34
41
 
35
42
  def trace(message, line_prefix=nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano_colors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Stjernstrom
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-21 00:00:00 +01:00
12
+ date: 2008-12-23 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,11 +32,11 @@ extra_rdoc_files:
32
32
  - lib/capistrano_colors.rb
33
33
  - README.rdoc
34
34
  files:
35
+ - capistrano_colors.gemspec
35
36
  - lib/capistrano_colors.rb
36
37
  - Manifest
37
38
  - Rakefile
38
39
  - README.rdoc
39
- - capistrano_colors.gemspec
40
40
  has_rdoc: true
41
41
  homepage: http://github.com/stjernstrom/capistrano_colors
42
42
  post_install_message: