https://github.com/naps62/capistrano-compact-formatter
A compact formatter for capistrano 3
https://github.com/naps62/capistrano-compact-formatter
Last synced: 12 months ago
JSON representation
A compact formatter for capistrano 3
- Host: GitHub
- URL: https://github.com/naps62/capistrano-compact-formatter
- Owner: naps62
- License: mit
- Created: 2015-02-03T16:00:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-03T17:49:32.000Z (over 11 years ago)
- Last Synced: 2025-03-27T22:36:52.705Z (over 1 year ago)
- Language: Ruby
- Size: 508 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Capistrano Compact Formatter
Custom formatter for Capistrano 3, with compact output, and opinionated according to my own needs.
I don't like the built-in formatters from sshkit. They're too verbose in debug mode, but too little verbose otherwise. Everytime an error occurred while using `set :debug, :info`, I would find myself changing it back to `:debug` to see the actual error messages.
A quick breakdown of what it does:
* no difference for each log level. I might add this in the future, but at this point, I didn't feel the need;
* each command is printed in a single line, containing a trimmed message and a success flag;
* if a command has output in stdout/stderr, it will be printed below, with a leading tab, in green/red respectively;
* conditional commands (i.e. commands with the format `[ some_bash_condition ]`) will not be printed. They frequently return false, which would output a red failure flag. I find that misleading, since it doesn't mean the deploy failed, it's merely a condition that evaluated to false.
Sample output:

## Installation
Add this line to your application's Gemfile:
```ruby
gem 'capistrano-compact-formatter'
```
Or install it yourself as:
$ gem install capistrano-compact-formatter
## Usage
And require it in your `Capfile`
```ruby
# Capfile
require 'capistrano-compact-formatter'
```
Then in your `config/deploy.rb`, specify the formatter to use:
```ruby
# config/deploy.rb
set :format, :compact
```
And you're all set!
## Contributing
1. Fork it ( https://github.com/[my-github-username]/capistrano-compact-formatter/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request