GitXplorerGitXplorer
h

rake-multilogs

public
1 stars
0 forks
1 issues

Commits

List of commits on branch master.
Verified
5dbd1161e8225bd589cd9d397e1bc2cd46f3e56a

Merge pull request #11 from haines/dependabot/bundler/rexml-3.2.5

hhaines committed 3 years ago
Verified
68d49b375681b6174de2ad4c90990ce591a7a01d

Bump rexml from 3.2.4 to 3.2.5

ddependabot[bot] committed 4 years ago
Verified
59be55fab10507c05a1e7c38a6527af441f644dd

Merge pull request #10 from haines/release-v0.3.0

hhaines committed 5 years ago
Verified
bf2946a44d4ad54b914cb2eb279024e95e3f4c21

Update changelog

hhaines committed 5 years ago
Verified
2196dd7fd6c30d6b383c1a77746c5c1cbdb6a6c0

Bump version

hhaines committed 5 years ago
Verified
5acdc0b8b1eac4b0760ef11e6eee4c282bb7cde5

Merge pull request #9 from haines/update

hhaines committed 5 years ago

README

The README file for this repository.

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.