Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

jewlerify

  • Loading branch information...
commit cb275f04f149a995599fc87b4662e1fdae4b8e93 1 parent 2721b8d
@jnewland authored
View
21 .gitignore
@@ -1 +1,22 @@
+## MAC OS
+.DS_Store
+
+## TEXTMATE
+*.tmproj
+tmtags
+
+## EMACS
+*~
+\#*
+.\#*
+
+## VIM
+*.swp
+
+## PROJECT::GENERAL
+coverage
+rdoc
+pkg
+
+## PROJECT::SPECIFIC
examples/campfire.rb
View
21 Rakefile
@@ -0,0 +1,21 @@
+$LOAD_PATH.unshift 'lib'
+require 'capistrano/log_with_awesome/version'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.version = Capistrano::LogWithAwesome::VERSION
+ gem.name = "capistrano-log_with_awesome"
+ gem.summary = %Q{logging callbacks for capistrano}
+ gem.description = %Q{logging callbacks for capistrano}
+ gem.email = "jnewland@gmail.com"
+ gem.homepage = "http://github.com/jnewland/capistrano-log_with_awesome"
+ gem.authors = ["Jesse Newland"]
+ gem.add_dependency "capistrano", ">= 2.5.14"
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
View
51 capistrano-log_with_awesome.gemspec
@@ -0,0 +1,51 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{capistrano-log_with_awesome}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Jesse Newland"]
+ s.date = %q{2010-02-27}
+ s.description = %q{logging callbacks for capistrano}
+ s.email = %q{jnewland@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".gitignore",
+ "Capfile",
+ "LICENSE",
+ "examples/campfire.rb.example",
+ "examples/raise.rb",
+ "examples/upload.rb",
+ "lib/capistrano/log_with_awesome.rb"
+ ]
+ s.homepage = %q{http://github.com/jnewland/capistrano-log_with_awesome}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{logging callbacks for capistrano}
+ s.test_files = [
+ "examples/raise.rb",
+ "examples/upload.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<capistrano>, [">= 2.5.14"])
+ else
+ s.add_dependency(%q<capistrano>, [">= 2.5.14"])
+ end
+ else
+ s.add_dependency(%q<capistrano>, [">= 2.5.14"])
+ end
+end
+
View
58 lib/capistrano/log_with_awesome.rb
@@ -1,35 +1,38 @@
-class Capistrano::LogWithAwesome < Capistrano::Logger
+require 'capistrano'
- #replaces the built in Capistrano logger with awesome
- def self.init(config)
- @config = config
- level = @config.logger.level
- @config.logger = new
- @config.logger.level = level
- end
+module Capistrano
+ class LogWithAwesome < Capistrano::Logger
+ #replaces the built in Capistrano logger with awesome
+ def self.init(config)
+ @config = config
+ level = @config.logger.level
+ @config.logger = new
+ @config.logger.level = level
+ end
- def self.log_with_awesome(message)
- @buffer ||= []
- @buffer << message
- @config.set :message, message
- @config.set :full_log, @buffer.join("\n")
- @config.silently_trigger(:log_message)
- end
+ def self.log_with_awesome(message)
+ @buffer ||= []
+ @buffer << message
+ @config.set :message, message
+ @config.set :full_log, @buffer.join("\n")
+ @config.silently_trigger(:log_message)
+ end
- # Log and do awesome things
- # I wish there was a nicer way to do this. Hax on device.puts, maybe?
- def log(level, message, line_prefix=nil)
- if level <= self.level
- indent = "%*s" % [Capistrano::Logger::MAX_LEVEL, "*" * (Capistrano::Logger::MAX_LEVEL - level)]
- (RUBY_VERSION >= "1.9" ? message.lines : message).each do |line|
- if line_prefix
- self.class.log_with_awesome "#{indent} [#{line_prefix}] #{line.strip}"
- else
- self.class.log_with_awesome "#{indent} #{line.strip}"
+ # Log and do awesome things
+ # I wish there was a nicer way to do this. Hax on device.puts, maybe?
+ def log(level, message, line_prefix=nil)
+ if level <= self.level
+ indent = "%*s" % [Capistrano::Logger::MAX_LEVEL, "*" * (Capistrano::Logger::MAX_LEVEL - level)]
+ (RUBY_VERSION >= "1.9" ? message.lines : message).each do |line|
+ if line_prefix
+ self.class.log_with_awesome "#{indent} [#{line_prefix}] #{line.strip}"
+ else
+ self.class.log_with_awesome "#{indent} #{line.strip}"
+ end
end
end
+ super(level, message, line_prefix)
end
- super(level, message, line_prefix)
end
end
@@ -47,6 +50,9 @@ def silently_trigger(event, task=nil)
end
end
+# load last in order to repoen rather than define
+require 'capistrano/log_with_awesome/version'
+
Capistrano::Configuration.instance.load do
Capistrano::LogWithAwesome.init(self)
end
View
5 lib/capistrano/log_with_awesome/version.rb
@@ -0,0 +1,5 @@
+module Capistrano
+ class LogWithAwesome
+ VERSION = '0.0.1'
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.