vergissberlin 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +10 -1
  3. data/bin/vergissberlin +1 -1
  4. data/lib/vergissberlin/version.rb +1 -1
  5. data/test/test_test.rb +7 -0
  6. data/test/utils.rb +37 -0
  7. data/vendor/bundle/bin/rake +23 -0
  8. data/vendor/bundle/bin/vergissberlin +23 -0
  9. data/vendor/bundle/build_info/capistrano_colors-0.5.5.info +1 -0
  10. data/vendor/bundle/build_info/rake-10.0.4.info +1 -0
  11. data/vendor/bundle/gems/capistrano_colors-0.5.5/Manifest +7 -0
  12. data/vendor/bundle/gems/capistrano_colors-0.5.5/README.rdoc +130 -0
  13. data/vendor/bundle/gems/capistrano_colors-0.5.5/Rakefile +1 -0
  14. data/vendor/bundle/gems/capistrano_colors-0.5.5/capistrano_colors.gemspec +33 -0
  15. data/vendor/bundle/gems/capistrano_colors-0.5.5/lib/capistrano_colors/configuration.rb +70 -0
  16. data/vendor/bundle/gems/capistrano_colors-0.5.5/lib/capistrano_colors/logger.rb +72 -0
  17. data/vendor/bundle/gems/capistrano_colors-0.5.5/lib/capistrano_colors.rb +18 -0
  18. data/vendor/bundle/gems/rake-10.0.4/CHANGES +530 -0
  19. data/vendor/bundle/gems/rake-10.0.4/MIT-LICENSE +21 -0
  20. data/vendor/bundle/gems/rake-10.0.4/README.rdoc +187 -0
  21. data/vendor/bundle/gems/rake-10.0.4/Rakefile +375 -0
  22. data/vendor/bundle/gems/rake-10.0.4/TODO +21 -0
  23. data/vendor/bundle/gems/rake-10.0.4/bin/rake +33 -0
  24. data/vendor/bundle/gems/rake-10.0.4/install.rb +90 -0
  25. data/vendor/bundle/gems/rake-10.0.4/lib/rake/alt_system.rb +109 -0
  26. data/vendor/bundle/gems/rake-10.0.4/lib/rake/application.rb +681 -0
  27. data/vendor/bundle/gems/rake-10.0.4/lib/rake/backtrace.rb +19 -0
  28. data/vendor/bundle/gems/rake-10.0.4/lib/rake/clean.rb +32 -0
  29. data/vendor/bundle/gems/rake-10.0.4/lib/rake/cloneable.rb +16 -0
  30. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/compositepublisher.rb +21 -0
  31. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/ftptools.rb +151 -0
  32. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/publisher.rb +73 -0
  33. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/rubyforgepublisher.rb +16 -0
  34. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/sshpublisher.rb +50 -0
  35. data/vendor/bundle/gems/rake-10.0.4/lib/rake/contrib/sys.rb +1 -0
  36. data/vendor/bundle/gems/rake-10.0.4/lib/rake/default_loader.rb +10 -0
  37. data/vendor/bundle/gems/rake-10.0.4/lib/rake/dsl_definition.rb +156 -0
  38. data/vendor/bundle/gems/rake-10.0.4/lib/rake/early_time.rb +18 -0
  39. data/vendor/bundle/gems/rake-10.0.4/lib/rake/ext/core.rb +27 -0
  40. data/vendor/bundle/gems/rake-10.0.4/lib/rake/ext/module.rb +0 -0
  41. data/vendor/bundle/gems/rake-10.0.4/lib/rake/ext/string.rb +168 -0
  42. data/vendor/bundle/gems/rake-10.0.4/lib/rake/ext/time.rb +15 -0
  43. data/vendor/bundle/gems/rake-10.0.4/lib/rake/file_creation_task.rb +24 -0
  44. data/vendor/bundle/gems/rake-10.0.4/lib/rake/file_list.rb +410 -0
  45. data/vendor/bundle/gems/rake-10.0.4/lib/rake/file_task.rb +47 -0
  46. data/vendor/bundle/gems/rake-10.0.4/lib/rake/file_utils.rb +114 -0
  47. data/vendor/bundle/gems/rake-10.0.4/lib/rake/file_utils_ext.rb +143 -0
  48. data/vendor/bundle/gems/rake-10.0.4/lib/rake/gempackagetask.rb +1 -0
  49. data/vendor/bundle/gems/rake-10.0.4/lib/rake/invocation_chain.rb +51 -0
  50. data/vendor/bundle/gems/rake-10.0.4/lib/rake/invocation_exception_mixin.rb +16 -0
  51. data/vendor/bundle/gems/rake-10.0.4/lib/rake/loaders/makefile.rb +40 -0
  52. data/vendor/bundle/gems/rake-10.0.4/lib/rake/multi_task.rb +13 -0
  53. data/vendor/bundle/gems/rake-10.0.4/lib/rake/name_space.rb +25 -0
  54. data/vendor/bundle/gems/rake-10.0.4/lib/rake/packagetask.rb +185 -0
  55. data/vendor/bundle/gems/rake-10.0.4/lib/rake/pathmap.rb +1 -0
  56. data/vendor/bundle/gems/rake-10.0.4/lib/rake/phony.rb +15 -0
  57. data/vendor/bundle/gems/rake-10.0.4/lib/rake/private_reader.rb +20 -0
  58. data/vendor/bundle/gems/rake-10.0.4/lib/rake/promise.rb +99 -0
  59. data/vendor/bundle/gems/rake-10.0.4/lib/rake/pseudo_status.rb +24 -0
  60. data/vendor/bundle/gems/rake-10.0.4/lib/rake/rake_module.rb +37 -0
  61. data/vendor/bundle/gems/rake-10.0.4/lib/rake/rake_test_loader.rb +22 -0
  62. data/vendor/bundle/gems/rake-10.0.4/lib/rake/rdoctask.rb +1 -0
  63. data/vendor/bundle/gems/rake-10.0.4/lib/rake/ruby182_test_unit_fix.rb +25 -0
  64. data/vendor/bundle/gems/rake-10.0.4/lib/rake/rule_recursion_overflow_error.rb +20 -0
  65. data/vendor/bundle/gems/rake-10.0.4/lib/rake/runtest.rb +22 -0
  66. data/vendor/bundle/gems/rake-10.0.4/lib/rake/task.rb +368 -0
  67. data/vendor/bundle/gems/rake-10.0.4/lib/rake/task_argument_error.rb +7 -0
  68. data/vendor/bundle/gems/rake-10.0.4/lib/rake/task_arguments.rb +78 -0
  69. data/vendor/bundle/gems/rake-10.0.4/lib/rake/task_manager.rb +296 -0
  70. data/vendor/bundle/gems/rake-10.0.4/lib/rake/tasklib.rb +22 -0
  71. data/vendor/bundle/gems/rake-10.0.4/lib/rake/testtask.rb +198 -0
  72. data/vendor/bundle/gems/rake-10.0.4/lib/rake/thread_history_display.rb +48 -0
  73. data/vendor/bundle/gems/rake-10.0.4/lib/rake/thread_pool.rb +155 -0
  74. data/vendor/bundle/gems/rake-10.0.4/lib/rake/trace_output.rb +22 -0
  75. data/vendor/bundle/gems/rake-10.0.4/lib/rake/version.rb +13 -0
  76. data/vendor/bundle/gems/rake-10.0.4/lib/rake/win32.rb +55 -0
  77. data/vendor/bundle/gems/rake-10.0.4/lib/rake.rb +71 -0
  78. data/vendor/bundle/gems/rake-10.0.4/test/file_creation.rb +34 -0
  79. data/vendor/bundle/gems/rake-10.0.4/test/helper.rb +562 -0
  80. data/vendor/bundle/gems/rake-10.0.4/test/test_private_reader.rb +42 -0
  81. data/vendor/bundle/gems/rake-10.0.4/test/test_rake.rb +40 -0
  82. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_application.rb +515 -0
  83. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_application_options.rb +455 -0
  84. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_backtrace.rb +89 -0
  85. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_clean.rb +14 -0
  86. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_definitions.rb +80 -0
  87. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_directory_task.rb +57 -0
  88. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_dsl.rb +40 -0
  89. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_early_time.rb +31 -0
  90. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_extension.rb +59 -0
  91. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_file_creation_task.rb +56 -0
  92. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_file_list.rb +628 -0
  93. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_file_list_path_map.rb +8 -0
  94. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_file_task.rb +122 -0
  95. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_file_utils.rb +305 -0
  96. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_ftp_file.rb +59 -0
  97. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_functional.rb +496 -0
  98. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_invocation_chain.rb +52 -0
  99. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_makefile_loader.rb +44 -0
  100. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_multi_task.rb +59 -0
  101. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_name_space.rb +43 -0
  102. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_package_task.rb +79 -0
  103. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_path_map.rb +157 -0
  104. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_path_map_explode.rb +34 -0
  105. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_path_map_partial.rb +18 -0
  106. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_pseudo_status.rb +21 -0
  107. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_rake_test_loader.rb +21 -0
  108. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_reduce_compat.rb +30 -0
  109. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_require.rb +40 -0
  110. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_rules.rb +327 -0
  111. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task.rb +340 -0
  112. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_argument_parsing.rb +103 -0
  113. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_arguments.rb +88 -0
  114. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_lib.rb +9 -0
  115. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_manager.rb +157 -0
  116. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_manager_argument_resolution.rb +19 -0
  117. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_task_with_arguments.rb +171 -0
  118. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_test_task.rb +120 -0
  119. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_thread_pool.rb +122 -0
  120. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_top_level_functions.rb +71 -0
  121. data/vendor/bundle/gems/rake-10.0.4/test/test_rake_win32.rb +72 -0
  122. data/vendor/bundle/gems/rake-10.0.4/test/test_thread_history_display.rb +91 -0
  123. data/vendor/bundle/gems/rake-10.0.4/test/test_trace_output.rb +50 -0
  124. data/vendor/bundle/specifications/capistrano_colors-0.5.5.gemspec +32 -0
  125. data/vendor/bundle/specifications/rake-10.0.4.gemspec +35 -0
  126. data/vergissberlin.gemspec +4 -2
  127. metadata +125 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5bee434d5c5c917020e8eed8f8ccbb002560060d
4
- data.tar.gz: 943ed5695af52d6cc827f13eda2c54441e5c1dab
3
+ metadata.gz: 0b68b208da76beb30cbb7bfae5fae36cdec87e8b
4
+ data.tar.gz: 7d297ce704653b74f261c8203e008514c1bcc730
5
5
  SHA512:
6
- metadata.gz: dec74099683e756aea74d5da87521f6329fe85432e2c3eb48bd33412cd7ec86334376da7601cede734ff67a8b2c1399a47584258d9c06a7d3f34832e512690f9
7
- data.tar.gz: 98222667ca5fda045be4ee10fd98e7cd4590f27b718f4b629e953df221b1d93c14bdc2d375bd0f2708baafd4030d861e5cc985cf5fa78d6a727f1b4b30039298
6
+ metadata.gz: a12fd751f9da6af8d8cd1b1726dd5cecd0f6ecddc37a558e95548f8c68298f8a5453c4e7377bfc566495cab383f5889d708dcb31c18b0a234b15ed67c3491f20
7
+ data.tar.gz: ef23189b12376e49f5e4e4d0777df90ba03a2064c3a71ceca97c138c91226ca07efdc3c46878bc1d0625ad8c1110214dd2016ff6f886774cdadbd3dc73972176
data/Rakefile CHANGED
@@ -1 +1,10 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/testtask'
5
+ Rake::TestTask.new(:test) do |test|
6
+ test.libs << 'lib' << 'test'
7
+ test.pattern = 'test/**/*_test.rb'
8
+ test.verbose = true
9
+ end
10
+ task :default => :test
data/bin/vergissberlin CHANGED
@@ -3,4 +3,4 @@
3
3
  #require 'capistrano/cli'
4
4
  #Capistrano::CLI.execute
5
5
 
6
- puts "You ar so cool!"
6
+ puts "You are so cool!"
@@ -1,3 +1,3 @@
1
1
  module Vergissberlin
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
data/test/test_test.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "utils"
2
+
3
+ class Test_Test < Test::Unit::TestCase
4
+ def test_a_test_case
5
+ assert true
6
+ end
7
+ end
data/test/utils.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'test/unit'
5
+ require 'mocha'
6
+
7
+ require 'capistrano/server_definition'
8
+ require 'pry'
9
+
10
+ module TestExtensions
11
+ def server(host, options={})
12
+ Capistrano::ServerDefinition.new(host, options)
13
+ end
14
+
15
+ def namespace(fqn=nil)
16
+ space = stub(:roles => {}, :fully_qualified_name => fqn, :default_task => nil)
17
+ yield(space) if block_given?
18
+ space
19
+ end
20
+
21
+ def role(space, name, *args)
22
+ opts = args.last.is_a?(Hash) ? args.pop : {}
23
+ space.roles[name] ||= []
24
+ space.roles[name].concat(args.map { |h| Capistrano::ServerDefinition.new(h, opts) })
25
+ end
26
+
27
+ def new_task(name, namespace=@namespace, options={}, &block)
28
+ block ||= Proc.new {}
29
+ task = Capistrano::TaskDefinition.new(name, namespace, options, &block)
30
+ assert_equal block, task.body
31
+ return task
32
+ end
33
+ end
34
+
35
+ class Test::Unit::TestCase
36
+ include TestExtensions
37
+ end
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by RubyGems.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'rubygems'
10
+
11
+ version = ">= 0"
12
+
13
+ if ARGV.first
14
+ str = ARGV.first
15
+ str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
16
+ if str =~ /\A_(.*)_\z/
17
+ version = $1
18
+ ARGV.shift
19
+ end
20
+ end
21
+
22
+ gem 'rake', version
23
+ load Gem.bin_path('rake', 'rake', version)
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by RubyGems.
4
+ #
5
+ # The application 'vergissberlin' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'rubygems'
10
+
11
+ version = ">= 0"
12
+
13
+ if ARGV.first
14
+ str = ARGV.first
15
+ str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
16
+ if str =~ /\A_(.*)_\z/
17
+ version = $1
18
+ ARGV.shift
19
+ end
20
+ end
21
+
22
+ gem 'vergissberlin', version
23
+ load Gem.bin_path('vergissberlin', 'vergissberlin', version)
@@ -0,0 +1,7 @@
1
+ README.rdoc
2
+ Rakefile
3
+ capistrano_colors.gemspec
4
+ lib/capistrano_colors.rb
5
+ lib/capistrano_colors/configuration.rb
6
+ lib/capistrano_colors/logger.rb
7
+ Manifest
@@ -0,0 +1,130 @@
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 capistrano_colors
9
+
10
+ == USAGE
11
+
12
+ === Per project installation
13
+
14
+ In config/deploy.rb
15
+
16
+ require 'capistrano_colors'
17
+
18
+
19
+ === System wide installation
20
+
21
+ Create/Modify you ~/.caprc with the following
22
+
23
+ require 'capistrano_colors'
24
+
25
+
26
+ == Creating you own color matchers
27
+
28
+ Create a custom colormatcher with the colorize command.
29
+ colorize can be called with a hash of options or an array of hashes.
30
+
31
+ The options hash should have the following fields.
32
+
33
+ * :match - A regular expression of the row to match.
34
+ * :color - The color we want on the matching rows.
35
+ * :prio - What prio should this rule have (higher = more prio)
36
+ * :attribute - Special effect (:underline, :reverse, :blink)
37
+ * :level - Specify if this matcher should be bound to some of capistranos log levels (info,debug,...)
38
+ * :prepend - Text to be prepended to the output
39
+ * :timestamp - Show current time with the output
40
+
41
+ === match
42
+ :match is a simple regular expression for the row that should be matched.
43
+
44
+ === color
45
+ :color can have the following values:
46
+
47
+ * :hide (hides the row completely)
48
+ * :none
49
+ * :black
50
+ * :red
51
+ * :green
52
+ * :yellow
53
+ * :blue
54
+ * :magenta
55
+ * :cyan
56
+ * :white
57
+
58
+ === prio
59
+ :prio is a Integer defining the matchers prio.
60
+
61
+ === attribute
62
+ :attribute can have the following values:
63
+
64
+ * :bright
65
+ * :dim
66
+ * :underscore
67
+ * :blink
68
+ * :reverse
69
+ * :hidden
70
+
71
+ == Example
72
+
73
+ require 'capistrano_colors'
74
+
75
+ capistrano_color_matchers = [
76
+ { :match => /command finished/, :color => :hide, :prio => 10 },
77
+ { :match => /executing command/, :color => :blue, :prio => 10, :attribute => :underscore },
78
+ { :match => /^transaction: commit$/, :color => :magenta, :prio => 10, :attribute => :blink },
79
+ { :match => /git/, :color => :white, :prio => 20, :attribute => :reverse },
80
+ ]
81
+
82
+ colorize( capistrano_color_matchers )
83
+
84
+
85
+ == CHANGES
86
+
87
+ v.0.5.5
88
+
89
+ - Added :timestamp option. Submitted by Mike Gunderloy
90
+
91
+ v.0.5.0
92
+
93
+ - Total rewrite and that is why we have a big version bump ;)
94
+ - Moved modules/classes to separate files.
95
+ - Wrote a simple color-regexp-match-engine.
96
+ - Possible to make you own custom color-matchers.
97
+
98
+ v.0.2.1
99
+
100
+ - Bugfix for some err: messages that where not printed in red.
101
+ - Moved console colors to constants
102
+ - Simple cleanup
103
+
104
+ == AUTHOR
105
+
106
+ Mathias Stjernström (http://pastbedti.me/)
107
+
108
+ == LICENSE
109
+
110
+ MIT License
111
+ Copyright (c) 2007 - 2008
112
+
113
+ Permission is hereby granted, free of charge, to any person obtaining
114
+ a copy of this software and associated documentation files (the
115
+ 'Software'), to deal in the Software without restriction, including
116
+ without limitation the rights to use, copy, modify, merge, publish,
117
+ distribute, sub-license, and/or sell copies of the Software, and to
118
+ permit persons to whom the Software is furnished to do so, subject to
119
+ the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be
122
+ included in all copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
125
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
126
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
127
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
128
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
129
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
130
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{capistrano_colors}
5
+ s.version = "0.5.5"
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{2011-03-17}
10
+ s.description = %q{Simple gem to display colors in capistrano output.}
11
+ s.email = %q{mathias@globalinn.com}
12
+ s.extra_rdoc_files = ["README.rdoc", "lib/capistrano_colors.rb", "lib/capistrano_colors/configuration.rb", "lib/capistrano_colors/logger.rb"]
13
+ s.files = ["README.rdoc", "Rakefile", "capistrano_colors.gemspec", "lib/capistrano_colors.rb", "lib/capistrano_colors/configuration.rb", "lib/capistrano_colors/logger.rb", "Manifest"]
14
+ s.homepage = %q{http://github.com/stjernstrom/capistrano_colors}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano_colors", "--main", "README.rdoc"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{capistranocolor}
18
+ s.rubygems_version = %q{1.3.7}
19
+ s.summary = %q{Simple gem to display colors in capistrano output.}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
+ s.add_development_dependency(%q<capistrano>, [">= 2.3.0"])
27
+ else
28
+ s.add_dependency(%q<capistrano>, [">= 2.3.0"])
29
+ end
30
+ else
31
+ s.add_dependency(%q<capistrano>, [">= 2.3.0"])
32
+ end
33
+ end
@@ -0,0 +1,70 @@
1
+ module Capistrano
2
+ class Configuration
3
+
4
+ # Add custom colormatchers
5
+ #
6
+ # Passing a hash or a array of hashes with custom colormatchers.
7
+ #
8
+ # Add the following to your deploy.rb or in your ~/.caprc
9
+ #
10
+ # == Example:
11
+ #
12
+ # require 'capistrano_colors'
13
+ #
14
+ # capistrano_color_matchers = [
15
+ # { :match => /command finished/, :color => :hide, :prio => 10, :prepend => "$$$" },
16
+ # { :match => /executing command/, :color => :blue, :prio => 10, :attribute => :underscore, :timestamp => true },
17
+ # { :match => /^transaction: commit$/, :color => :magenta, :prio => 10, :attribute => :blink },
18
+ # { :match => /git/, :color => :white, :prio => 20, :attribute => :reverse },
19
+ # ]
20
+ #
21
+ # colorize( capistrano_color_matchers )
22
+ #
23
+ # You can call colorize multiple time with either a hash or an array of hashes multiple times.
24
+ #
25
+ # == Colors:
26
+ #
27
+ # :color can have the following values:
28
+ #
29
+ # * :hide (hides the row completely)
30
+ # * :none
31
+ # * :black
32
+ # * :red
33
+ # * :green
34
+ # * :yellow
35
+ # * :blue
36
+ # * :magenta
37
+ # * :cyan
38
+ # * :white
39
+ #
40
+ # == Attributes:
41
+ #
42
+ # :attribute can have the following values:
43
+ #
44
+ # * :bright
45
+ # * :dim
46
+ # * :underscore
47
+ # * :blink
48
+ # * :reverse
49
+ # * :hidden
50
+ #
51
+ #
52
+ # == Text alterations
53
+ #
54
+ # :prepend gives static text to be prepended to the output
55
+ # :timestamp adds the current time before the output
56
+ #
57
+ def colorize(options)
58
+
59
+ if options.class == Array
60
+ options.each do |opt|
61
+ Capistrano::Logger.add_color_matcher( opt )
62
+ end
63
+ else
64
+ Capistrano::Logger.add_color_matcher( options )
65
+
66
+ end
67
+ end
68
+
69
+ end
70
+ end
@@ -0,0 +1,72 @@
1
+ module Capistrano
2
+ class Logger
3
+
4
+ CAP_COLORS = {
5
+ :none => "0",
6
+ :black => "30",
7
+ :red => "31",
8
+ :green => "32",
9
+ :yellow => "33",
10
+ :blue => "34",
11
+ :magenta => "35",
12
+ :cyan => "36",
13
+ :white => "37"
14
+ }
15
+
16
+ CAP_ATTRIBUTES = {
17
+ :bright => 1,
18
+ :dim => 2,
19
+ :underscore => 4,
20
+ :blink => 5,
21
+ :reverse => 7,
22
+ :hidden => 8
23
+ }
24
+
25
+ @@color_matchers = []
26
+
27
+ alias_method :org_log, :log
28
+
29
+ def log(level, message, line_prefix=nil) #:nodoc:
30
+
31
+ color = :none
32
+ attribute = nil
33
+
34
+ # Sort matchers in reverse order so we can break if we found a match.
35
+ @@sorted_color_matchers ||= @@color_matchers.sort_by { |i| -i[:prio] }
36
+
37
+ @@sorted_color_matchers.each do |filter|
38
+
39
+ if (filter[:level] == level || filter[:level].nil?)
40
+ if message =~ filter[:match] || line_prefix =~ filter[:match]
41
+ color = filter[:color]
42
+ attribute = filter[:attribute]
43
+ message = filter[:prepend] + message unless filter[:prepend].nil?
44
+ message = Time.now.strftime('%T') + ' ' + message if filter[:timestamp]
45
+ break
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ if color != :hide
52
+ current_color = CAP_COLORS[color]
53
+ current_attribute = CAP_ATTRIBUTES[attribute]
54
+
55
+ line_prefix = colorize(line_prefix.to_s, current_color, current_attribute, nil) unless line_prefix.nil?
56
+ org_log(level, colorize(message, current_color, current_attribute), line_prefix)
57
+ end
58
+
59
+ end
60
+
61
+ def self.add_color_matcher( options ) #:nodoc:
62
+ @@color_matchers.push( options )
63
+ end
64
+
65
+ def colorize(message, color, attribute, nl = "\n")
66
+ attribute = "#{attribute};" if attribute
67
+ "\e[#{attribute}#{color}m" + message.strip + "\e[0m#{nl}"
68
+ end
69
+
70
+ end
71
+
72
+ end