0.0
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Rake multitask logs can be confusing, with interleaved output from all parallel tasks. Rake::Multilogs untangles the mess by capturing each task's output and displaying it after all the tasks are finished.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
~> 5.11
~> 0.11
~> 0.80.1
~> 0.9

Runtime

>= 12.1, < 14.0
 Project Readme

Rake::Multilogs

Docs Gem GitHub License Travis

Rake multitask logs can be confusing, with output from each of the concurrently-running tasks being interleaved. Rake::Multilogs untangles the mess by capturing each task's output and displaying it after all the tasks are finished.

Installation

Add this line to your application's Gemfile:

gem "rake-multilogs"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install rake-multilogs

JRuby and Windows are not supported, because Process.fork is unavailable. Rake::Multilogs will gracefully fall back to the default (interleaved) output on those platforms.

Usage

Add this line to your application's Rakefile:

require "rake/multilogs"

Your multitasks will now run concurrently in forked processes, with each task's output displayed after all tasks have completed.

The use of forking rather than the default threading implementation means that database connections and other resources need to be handled carefully. You need to make sure each forked process has its own connection by using the before_fork and after_fork hooks.

For example, with Active Record, you can put the following config in your Rakefile:

Rake::Multilogs.before_fork do
  ActiveRecord::Base.connection.disconnect!
end

Rake::Multilogs.after_fork do
  ActiveRecord::Base.establish_connection
end

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bin/rake install. To release a new version, update the version number in lib/rake/multilogs/version.rb, and then run bin/rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to RubyGems.

Contributing

Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

© 2018 Andrew Haines, released under the MIT license.