rubocop-daemon
rubocop-daemon
makes RuboCop faster.
Installation
Install rubocop-daemon
via rubygems.org:
gem install rubocop-daemon
Usage
To start the server, just run:
rubocop-daemon start
Then you can execute RuboCop fast:
rubocop-daemon exec
And you can pass files:
rubocop-daemon exec foo.rb bar.rb
If you want to pass arguments to RuboCop, you should separate arguments by --
:
rubocop-daemon exec -- --auto-correct
Commands
You can control the server like this:
rubocop-daemon <command>
Available commands:
start
: start the serverstop
: stop the serverstatus
: print out whether the server is currently runningrestart
: restart the serverexec [file1, file2, ...] [-- [rubocop-options]]
: invokerubocop
with the givenrubocop-options
More speed
If you're really into performance and want the lowest possible latency, talk to the rubocop-daemon
server with netcat:
echo "$(cat ~/.cache/rubocop-daemon/token) $PWD exec [rubocop-options]" | nc localhost $(cat ~/.cache/rubocop-daemon/port)
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/fohte/rubocop-daemon.
License
The gem is available as open source under the terms of the MIT License.