Devpack

Include a single gem in your Gemfile to allow developers to optionally include their preferred set of development gems without cluttering the Gemfile. Configurable globally or per-project.

Installation

Create a file named .devpack in your project's directory, or in any parent directory:

# .devpack
awesome_print
byebug
better_errors

# Optionally specify a version:
pry:0.13.1

# Or add an asterisk at the start of a line to not require the gem automatically:
# (equivalent to adding `require: false` to the gem's entry in the Gemfile)
*brakeman

Add Devpack to any project's Gemfile:

# Gemfile
group :development, :test do
  gem 'devpack', '~> 0.4.0'
end

Rebuild your bundle:

bundle install

Usage

Load Devpack (if your gems are not auto-loaded as in e.g. a Rails application environment):

require 'devpack'

Devpack will attempt to load all configured gems immediately, providing feedback to stderr. All dependencies are loaded with require after being recursively verified for compatibily with bundled gems before loading.

It is recommended to use a global configuration.

When using a per-project configuration, .devpack files should be added to .gitignore.

Gem Installation

A convenience command is provided to install all gems listed in .devpack file that are not already installed:

bundle exec devpack install

Executing Commands Provided by DevPack Gems

Use the exec command to run a command provided by a gem installed via Devpack.

An example use case of this is the Guard gem:

bundle exec devpack exec guard

Initializers

Custom initializers can be loaded by creating a directory named .devpack_initializers containing a set of .rb files.

Initializers will be loaded in alphabetical order after all gems listed in the .devpack configuration file have been loaded.

Initializers that fail to load (for any reason) will generate a warning.

# .devpack_initializers/pry.rb

Pry.config.pager = false

Rails

If Rails is detected then files in the .devpack_initializers directory will be loaded using the Rails after_initialize hook (i.e. after all other frameworks have been initialized).

# .devpack_initializers/bullet.rb

Bullet.enable = true

Global Configuration

To configure globally simply save your .devpack configuration file to any parent directory of your project directory, e.g. ~/.devpack.

This strategy also applies to .devpack_initializers.

Silencing

To prevent Devpack from displaying messages on load, set the environment variable DEVPACK_SILENT=1 to any value:

DEVPACK_SILENT=1 bundle exec ruby myapp.rb

Disabling

To disable Devpack set the environment variable DEVPACK_DISABLE to any value:

DEVPACK_DISABLE=1 bundle exec ruby myapp.rb

Debugging

To see the full traceback of any errors encountered at load time set the environment variable DEVPACK_DEBUG to any value:

DEVPACK_DEBUG=1 bundle exec ruby myapp.rb

License

The gem is available as open source under the terms of the MIT License.