stjernstrom-capistrano_colors 0.2.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.
data/Manifest ADDED
@@ -0,0 +1,5 @@
1
+ capistrano_colors.gemspec
2
+ lib/capistrano_colors.rb
3
+ Manifest
4
+ Rakefile
5
+ README.rdoc
data/README.rdoc ADDED
@@ -0,0 +1,42 @@
1
+ == DESCRIPTION
2
+
3
+ The aim of capistrano_colors is to make the capistrano output more userfriendly.
4
+ When capistrano_colors is included in your deploy.rb capistrano output gets nice and shiny colors.
5
+
6
+ == INSTALLATION
7
+
8
+ sudo gem install stjernstrom-capistrano_colors --source http://gems.github.com
9
+
10
+ == USAGE
11
+
12
+ In your config/deploy.rb
13
+
14
+ require 'capistrano_colors'
15
+
16
+ == AUTHOR
17
+
18
+ Mathias Stjernström (http://pastbedti.me/)
19
+
20
+ == LICENSE
21
+
22
+ MIT License
23
+ Copyright (c) 2007 - 2008
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining
26
+ a copy of this software and associated documentation files (the
27
+ 'Software'), to deal in the Software without restriction, including
28
+ without limitation the rights to use, copy, modify, merge, publish,
29
+ distribute, sub-license, and/or sell copies of the Software, and to
30
+ permit persons to whom the Software is furnished to do so, subject to
31
+ the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be
34
+ included in all copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
37
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
39
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
40
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
41
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
42
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,15 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'echoe'
4
+
5
+ Echoe.new('capistrano_colors', '0.2.0') do |p|
6
+ p.description = "Simple gem to display colors in capistrano output."
7
+ p.url = "http://github.com/stjernstrom/capistrano_colors"
8
+ p.author = "Mathias Stjernstrom"
9
+ p.email = "mathias@globalinn.com"
10
+ p.ignore_pattern = ["tmp/*", "script/*"]
11
+ p.development_dependencies = ["capistrano >=2.3.0"]
12
+ end
13
+
14
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
15
+
@@ -0,0 +1,34 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{capistrano_colors}
5
+ s.version = "0.2.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Mathias Stjernstrom"]
9
+ s.date = %q{2008-12-21}
10
+ s.description = %q{Simple gem to display colors in capistrano output.}
11
+ s.email = %q{mathias@globalinn.com}
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"]
14
+ s.has_rdoc = true
15
+ s.homepage = %q{http://github.com/stjernstrom/capistrano_colors}
16
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano_colors", "--main", "README.rdoc"]
17
+ s.require_paths = ["lib"]
18
+ s.rubyforge_project = %q{capistrano_colors}
19
+ s.rubygems_version = %q{1.3.1}
20
+ s.summary = %q{Simple gem to display colors in capistrano output.}
21
+
22
+ if s.respond_to? :specification_version then
23
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
+ s.specification_version = 2
25
+
26
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
+ s.add_development_dependency(%q<capistrano>, [">= 2.3.0"])
28
+ else
29
+ s.add_dependency(%q<capistrano>, [">= 2.3.0"])
30
+ end
31
+ else
32
+ s.add_dependency(%q<capistrano>, [">= 2.3.0"])
33
+ end
34
+ end
@@ -0,0 +1,39 @@
1
+ puts "\e[36m == capistrano_colors loaded ==\e[0m"
2
+
3
+ module Capistrano
4
+ class Logger
5
+
6
+ def colorize(message, color, nl = "\n")
7
+ "\e[#{color}m" + message.strip + "\e[0m#{nl}"
8
+ end
9
+
10
+ def debug(message, line_prefix=nil)
11
+ 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)
15
+ else
16
+ log(DEBUG, colorize(message, "33"), line_prefix)
17
+ end
18
+ end
19
+
20
+ def info(message, line_prefix=nil)
21
+ if message =~ /.*out\] (fatal:|ERROR:).*/
22
+ color = "31"
23
+ elsif message =~ /Permission denied/
24
+ color = "31"
25
+ else
26
+ color = "0"
27
+ end
28
+ log(INFO, colorize(message,color), line_prefix)
29
+ end
30
+
31
+ def important(message, line_prefix=nil)
32
+ log(IMPORTANT, colorize(message, "34"), line_prefix)
33
+ end
34
+
35
+ def trace(message, line_prefix=nil)
36
+ log(TRACE, message, line_prefix)
37
+ end
38
+ end
39
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stjernstrom-capistrano_colors
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Mathias Stjernstrom
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-21 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.3.0
23
+ version:
24
+ description: Simple gem to display colors in capistrano output.
25
+ email: mathias@globalinn.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - lib/capistrano_colors.rb
32
+ - README.rdoc
33
+ files:
34
+ - lib/capistrano_colors.rb
35
+ - Manifest
36
+ - Rakefile
37
+ - README.rdoc
38
+ - capistrano_colors.gemspec
39
+ has_rdoc: true
40
+ homepage: http://github.com/stjernstrom/capistrano_colors
41
+ post_install_message:
42
+ rdoc_options:
43
+ - --line-numbers
44
+ - --inline-source
45
+ - --title
46
+ - Capistrano_colors
47
+ - --main
48
+ - README.rdoc
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "1.2"
62
+ version:
63
+ requirements: []
64
+
65
+ rubyforge_project: capistrano_colors
66
+ rubygems_version: 1.2.0
67
+ signing_key:
68
+ specification_version: 2
69
+ summary: Simple gem to display colors in capistrano output.
70
+ test_files: []
71
+