ProcessFlags

Process flags are files in the log directory that can be used to change the functionality of the process without needing a restart.

Installation

Add this line to your application's Gemfile:

gem 'process_flags'

And then execute:

$ bundle

Or install it yourself as:

$ gem install process_flags

Usage

The following method checks for a process flag.

ProcessFlags.is_set?(:disable_slave_database_access)

The above will return true if the file "log/flag.disable_slave_database_access" exists.

You can also store values in a process flag. For example:

ProcessFlags[:max_calls]

This returns nil if the file does not exist, or it returns the content of the file.

Development

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

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/process_flags/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