capistrano_colors 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest ADDED
@@ -0,0 +1,4 @@
1
+ lib/capistrano_colors.rb
2
+ Manifest
3
+ Rakefile
4
+ 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,16 @@
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
+ p.project = "capistranocolor"
13
+ end
14
+
15
+ Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
16
+
@@ -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{capistranocolor}
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,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: 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 +01:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.3.0
24
+ version:
25
+ description: Simple gem to display colors in capistrano output.
26
+ email: mathias@globalinn.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - lib/capistrano_colors.rb
33
+ - README.rdoc
34
+ files:
35
+ - lib/capistrano_colors.rb
36
+ - Manifest
37
+ - Rakefile
38
+ - README.rdoc
39
+ - capistrano_colors.gemspec
40
+ has_rdoc: true
41
+ homepage: http://github.com/stjernstrom/capistrano_colors
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --line-numbers
45
+ - --inline-source
46
+ - --title
47
+ - Capistrano_colors
48
+ - --main
49
+ - README.rdoc
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "1.2"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project: capistranocolor
67
+ rubygems_version: 1.3.1
68
+ signing_key:
69
+ specification_version: 2
70
+ summary: Simple gem to display colors in capistrano output.
71
+ test_files: []
72
+