Installation¶
Requirements¶
- Ruby >= 2.3.0
- No external dependencies
Installing via RubyGems¶
Install directly from RubyGems:
Installing via Bundler¶
Add this line to your application's Gemfile:
Then execute:
Development Installation¶
For development purposes, you may want to install with development dependencies:
This ensures the gem is only loaded in development environments.
Rails Integration¶
For Rails applications, add to your Gemfile:
Create an initializer at config/initializers/debug_me.rb:
require 'debug_me'
# Include globally so debug_me is available everywhere
include DebugMe
# Disable in production
$DEBUG_ME = !Rails.env.production?
# Configure defaults for your application
DebugMeDefaultOptions.merge!(
tag: Rails.application.class.module_parent_name.upcase,
logger: Rails.logger,
time: true
)
Include Strategies
You have several options for including the module:
- Global (shown above):
include DebugMeat top level makesdebug_meavailable everywhere - Controllers only: Include in
ApplicationController - Models only: Include in
ApplicationRecord - Specific classes: Include only where needed
- No include: Use
DebugMe.debug_me { :var }anywhere
See Configuration for detailed examples.
Verifying Installation¶
After installation, verify it works:
You should see output similar to:
Updating¶
To update to the latest version: