### Example Workflow: Make Changes, Run Tests, Check Style Source: https://github.com/danmayer/coverband/blob/main/agents.md A complete workflow example demonstrating the process of making code changes, running tests, and verifying code style. ```bash # 1. Make changes to code vim lib/coverband/some_file.rb # 2. Run tests bundle exec rake test # 3. Fix any failures, re-run until passing bundle exec rake test ``` -------------------------------- ### Manually Start Coverband Source: https://github.com/danmayer/coverband/blob/main/README.md Call `Coverband.configure` followed by `Coverband.start` to manually start Coverband when auto-start is disabled. ```ruby Coverband.configure Coverband.start ``` -------------------------------- ### Troubleshooting MCP Not Starting Error Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md When MCP is not starting due to security reasons, ensure it is enabled and the current environment is allowed. ```text ❌ ERROR: MCP is not enabled for security reasons. ``` -------------------------------- ### Run Coverband MCP Server (Standalone) Source: https://github.com/danmayer/coverband/blob/main/README.md Start the MCP server using stdio transport for local development with AI assistants. ```bash bundle exec coverband-mcp ``` -------------------------------- ### Capture Coverage Data with TracePoint Source: https://github.com/danmayer/coverband/blob/main/docs/internal_formats.md Demonstrates how to start coverage collection and capture the results using Ruby's Coverage module. The output format includes file paths and an array representing line coverage counts. ```ruby >> require 'coverage' => true >> Coverage.start => nil >> require './test/unit/dog.rb' => true >> 5.times { Dog.new.bark } => 5 >> Coverage.peek_result => {"/Users/danmayer/projects/coverband/test/unit/dog.rb"=>[nil, nil, 1, 1, 5, nil, nil]} ``` -------------------------------- ### Example Production Coverband Configuration Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md This Ruby configuration sets up Coverband for production and staging environments, requiring a secure password via environment variable and restricting access. ```ruby # config/initializers/coverband.rb Coverband.configure do |config| # Standard coverband config... config.store = Coverband::Adapters::RedisStore.new(Redis.new) # MCP Security Configuration config.mcp_enabled = Rails.env.production? || Rails.env.staging? config.mcp_password = ENV.fetch('COVERBAND_MCP_PASSWORD') { raise 'COVERBAND_MCP_PASSWORD environment variable required for MCP access' } config.mcp_allowed_environments = %w[production staging] end ``` -------------------------------- ### Configure Claude Desktop (HTTP Transport) Source: https://github.com/danmayer/coverband/blob/main/README.md Configure Claude Desktop to connect to a Coverband MCP server running in HTTP mode. First, start the server in HTTP mode, then point Claude Desktop to the specified URL. ```json { "mcpServers": { "coverband": { "command": "npx", "args": ["mcp-remote", "http://localhost:9023"] } } } ``` -------------------------------- ### Start Coverband Standalone Server Source: https://github.com/danmayer/coverband/blob/main/README.md Run the Coverband coverage server using a rake task. You can specify an alternative port or connect to a production Redis server using environment variables. ```bash bundle exec rake coverband:coverage_server ``` ```bash COVERBAND_COVERAGE_PORT=8086 bundle exec rake coverband:coverage_server ``` ```bash COVERBAND_REDIS_URL=redis://username:password@redis_production_server:2322 bundle exec rake coverband:coverage_server ``` -------------------------------- ### Add Coverband Gem to Gemfile Source: https://github.com/danmayer/coverband/blob/main/README.md Include the 'coverband' gem in your application's Gemfile to integrate Coverband into your project. Remember to run 'bundle install'. ```ruby gem 'coverband' ``` -------------------------------- ### Defer Eager Loading Data Source: https://github.com/danmayer/coverband/blob/main/README.md Defer saving eager_loading data to omit reporting on starting servers. This is required to use send_deferred_eager_loading_data. ```ruby config.defer_eager_loading_data = true ``` -------------------------------- ### Require Coverband in Sinatra Config Source: https://github.com/danmayer/coverband/blob/main/README.md Require Coverband as early as possible in your Sinatra application's config.ru for best coverage. This snippet shows the basic setup. ```ruby require 'coverband' require File.dirname(__FILE__) + '/config/environment' use Coverband::BackgroundMiddleware run ActionController::Dispatcher.new ``` -------------------------------- ### Ignore Specific Files and Patterns Source: https://github.com/danmayer/coverband/blob/main/README.md Configure Coverband to ignore certain files or patterns from coverage reports. This is useful for files that are not part of your application's core logic or are run infrequently. The example ignores configuration files, rake tasks, and environment-specific files. ```ruby config.ignore += ['config/application.rb', 'config/boot.rb', 'config/puma.rb', 'config/schedule.rb', 'bin/.*', 'config/environments/.*', 'lib/tasks/.*'] ``` -------------------------------- ### Run a Single Test File Source: https://github.com/danmayer/coverband/blob/main/README.md Execute a specific test file for Coverband. ```ruby bundle exec ruby test/coverband/collectors/translation_tracker_test.rb ``` -------------------------------- ### Enable MCP with Basic Password in Development Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Enable MCP for local development and set a basic password. Remember to use a strong password in production. ```ruby Coverband.configure do |config| config.mcp_enabled = true config.mcp_password = 'dev-password-123' # Use strong password in production end ``` -------------------------------- ### Run Standard Test Suite with Rake Source: https://github.com/danmayer/coverband/blob/main/agents.md Execute the main integration and unit tests for Coverband. Ensure all code changes pass this suite. ```bash bundle exec rake test ``` -------------------------------- ### Run Coverband MCP Server (HTTP Mode) Source: https://github.com/danmayer/coverband/blob/main/README.md Enable HTTP transport for the MCP server to allow remote access or integration with services like Claude Desktop. Specify the port using COVERBAND_MCP_PORT. ```bash COVERBAND_MCP_HTTP=true COVERBAND_MCP_PORT=9023 bundle exec rake coverband:mcp ``` -------------------------------- ### Configure Production MCP with Strong Authentication Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Enable MCP in production, use a strong password from an environment variable, and restrict to specific environments. ```ruby Coverband.configure do |config| # Enable MCP only in allowed environments config.mcp_enabled = true # Strong authentication (required for production) config.mcp_password = ENV['COVERBAND_MCP_PASSWORD'] # Restrict to specific environments config.mcp_allowed_environments = %w[production staging] end ``` -------------------------------- ### Configure Claude Desktop (Stdio Transport) Source: https://github.com/danmayer/coverband/blob/main/README.md Set up Claude Desktop to use the Coverband MCP server via stdio transport. Ensure the 'cwd' points to your Rails application's root directory. ```json { "mcpServers": { "coverband": { "command": "bundle", "args": ["exec", "coverband-mcp"], "cwd": "/path/to/your/rails/app" } } } ``` -------------------------------- ### Run Coverband Tests Source: https://github.com/danmayer/coverband/blob/main/README.md Execute the test suite for Coverband. Ensure Redis is running before execution. ```ruby bundle install rake test ``` -------------------------------- ### Set up SSH Tunnel to Production Server Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Establish an SSH tunnel to the production server to securely access its MCP service from your development machine. ```bash # SSH tunnel to production ssh -L 9023:localhost:9023 production-server ``` -------------------------------- ### Run StandardRB Linter with GitHub Format Source: https://github.com/danmayer/coverband/blob/main/agents.md Check code style compliance using StandardRB, formatted for GitHub Actions compatibility. All code must pass this check. ```bash bundle exec standardrb --format github ``` -------------------------------- ### Run Coverband MCP Server (Rake Task) Source: https://github.com/danmayer/coverband/blob/main/README.md Execute the MCP server via a rake task, useful for integration into your project's build or development workflow. ```bash bundle exec rake coverband:mcp ``` -------------------------------- ### Enable MCP via Environment Variable Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Configure MCP password using an environment variable for development. ```bash export COVERBAND_MCP_PASSWORD=dev-password-123 ``` -------------------------------- ### systemd Service for Coverband MCP Server Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Configure systemd to manage the Coverband MCP server as a service on Linux systems. Ensure correct paths and environment variables are set. ```ini # /etc/systemd/system/coverband-mcp.service [Unit] Description=Coverband MCP Server After=network.target [Service] Type=simple User=deployer WorkingDirectory=/app ExecStart=/usr/local/bin/ruby /app/script/mcp_server.rb Environment=RAILS_ENV=production Environment=COVERBAND_MCP_PASSWORD=your-secure-password Restart=always [Install] WantedBy=multi-user.target ``` -------------------------------- ### Verify Coverband Rake Tasks Source: https://github.com/danmayer/coverband/blob/main/README.md Verify that the Coverband rake tasks are available and listed. ```bash rake -T coverband ``` -------------------------------- ### Run Coverband Tests with Rails 7 Source: https://github.com/danmayer/coverband/blob/main/README.md Execute the test suite for Coverband using Rails 7. Ensure Redis is running before execution. ```ruby BUNDLE_GEMFILE=Gemfile.rails7 bundle exec rake ``` -------------------------------- ### Run Full Test Suite with Rake Source: https://github.com/danmayer/coverband/blob/main/agents.md Execute all tests, including benchmarks and memory tests. This provides a comprehensive test coverage check. ```bash bundle exec rake test:all ``` -------------------------------- ### Configure Development Environment to Access Production MCP Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Configure the development environment to enable MCP and use the production MCP password, typically sourced from an environment variable. ```ruby # config/environments/development.rb Coverband.configure do |config| config.mcp_enabled = true # Use production MCP password for access config.mcp_password = ENV['PRODUCTION_MCP_PASSWORD'] end ``` -------------------------------- ### Integrate dotenv for Environment Variables Source: https://github.com/danmayer/coverband/blob/main/README.md Ensure environment variables are loaded before Coverband by requiring 'dotenv/load' early in your Gemfile. This is crucial if Coverband or other gems rely on environment variables for their configuration. ```ruby gem 'dotenv', require: 'dotenv/load' gem 'coverband' gem 'other-gem-that-requires-env-variables' ``` -------------------------------- ### Gemfile Configuration for Resque and Coverband Source: https://github.com/danmayer/coverband/wiki/Resque-Integration Ensure 'resque' is loaded before 'coverband' in your Gemfile for seamless integration. This order is crucial for Coverband to correctly instrument Resque tasks. ```ruby source 'https://rubygems.org' gem 'resque' gem 'coverband' gem 'rake' ``` -------------------------------- ### Set Secure Environment Variables for Production Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Generate a strong, unique password for MCP access and set the Rails environment. ```bash # Strong, unique password for MCP access export COVERBAND_MCP_PASSWORD="$(openssl rand -base64 32)" # Optional: Restrict Rails environment (auto-detected if not set) export RAILS_ENV=production ``` -------------------------------- ### Mount Coverband Rack App in Rails Source: https://github.com/danmayer/coverband/blob/main/README.md Integrate Coverband's web UI into your Rails application by mounting it in `config/routes.rb`. Ensure your source code is protected with proper authentication. ```ruby Rails.application.routes.draw do mount Coverband::Reporters::Web.new, at: '/coverage' end ``` ```ruby Rails.application.routes.draw do authenticate :user, lambda { |u| u.admin? } do mount Coverband::Reporters::Web.new, at: '/coverage' end end ``` -------------------------------- ### Send Deferred Eager Loading Data (Environment Variable) Source: https://github.com/danmayer/coverband/blob/main/README.md Store eager_loading data on servers with a specific environment variable set. This option requires defer_eager_loading_data to be true. ```ruby config.send_deferred_eager_loading_data = ENV.fetch('ENABLE_EAGER_LOADING_COVERAGE', false) ``` -------------------------------- ### Redis Store Formats for Coverband Source: https://github.com/danmayer/coverband/blob/main/docs/internal_formats.md Illustrates the data structures used for storing coverage information in Redis. It includes an array for relative file paths and a hash mapping line numbers to their execution counts as strings. ```ruby # Array ["test/unit/dog.rb"] ``` ```ruby # Hash {"test/unit/dog.rb"=>{"1"=>"1", "2"=>"2"}} ``` -------------------------------- ### Configure Coverband for Debugging Source: https://github.com/danmayer/coverband/blob/main/README.md Enable verbose logging and set the logger to Rails.logger for debugging Coverband issues. Be cautious not to leave these settings in production. ```ruby config.verbose = true config.logger = Rails.logger ``` -------------------------------- ### Configure Redis with TLS in coverband.rb Source: https://github.com/danmayer/coverband/blob/main/README.md Explicitly define the Redis store in config/coverband.rb using the 'rediss://' URL scheme for TLS connections. ```ruby config.store = Coverband::Adapters::RedisStore.new( Redis.new(url: "rediss://my-elasticache-endpoint:6379") ) ``` -------------------------------- ### Configure Claude Code (Stdio Transport) Source: https://github.com/danmayer/coverband/blob/main/README.md Create a .mcp.json file in your project root to configure Claude Code for Coverband MCP server using stdio transport. ```json { "mcpServers": { "coverband": { "command": "bundle", "args": ["exec", "coverband-mcp"] } } } ``` -------------------------------- ### AI Assistant Configuration for Production Coverband Data Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Configure an AI assistant to fetch production Coverband coverage data using cURL commands, specifying authorization and content type. ```json { "mcp": { "servers": { "coverband-production": { "command": "curl", "args": [ "-H", "Authorization: Bearer ${PRODUCTION_MCP_PASSWORD}", "-H", "Content-Type: application/json", "http://localhost:9023/mcp" ], "description": "Production Coverband coverage data" } } } } ``` -------------------------------- ### Run Default Rake Task Source: https://github.com/danmayer/coverband/blob/main/agents.md Equivalent to running the standard test suite. This is the default task when no specific Rake task is provided. ```bash bundle exec rake ``` -------------------------------- ### Send Deferred Eager Loading Data (Random) Source: https://github.com/danmayer/coverband/blob/main/README.md Store eager_loading data on a random percentage of servers. This option requires defer_eager_loading_data to be true. ```ruby config.send_deferred_eager_loading_data = rand(100) < 5 ``` -------------------------------- ### Integrate MCP as a Rack Application Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Mount the Coverband MCP endpoint within a Rack application, making it accessible at a specified path. ```ruby # config.ru require 'coverband/mcp' # Mount MCP endpoint alongside web UI map "/coverage" do run Coverband::MCP::HttpHandler.new(Coverband::Reporters::Web.new) end # Access MCP at POST /coverage/mcp ``` -------------------------------- ### Configure Reporting Wiggle Source: https://github.com/danmayer/coverband/blob/main/README.md Add a random wiggle (in seconds) to the background thread to avoid all servers reporting at the same time. The default is 30 seconds. ```ruby config.reporting_wiggle = 30 ``` -------------------------------- ### Debug Redis Store: Covered Files Source: https://github.com/danmayer/coverband/blob/main/README.md View the list of files that have been synced to the Redis store. ```ruby Coverband.configuration.store.covered_files ``` -------------------------------- ### File Store Format for Coverband Source: https://github.com/danmayer/coverband/blob/main/docs/internal_formats.md Shows the format used for storing coverage data in a file-based store. It is similar to the Redis store but uses integer values for line counts instead of strings. ```json {"test/unit/dog.rb"=>{"1"=>1, "2"=>2}} ``` -------------------------------- ### Enable Query Burst Tracking in Coverband Source: https://github.com/danmayer/coverband/blob/main/README.md Enable the Query Burst Tracker and set thresholds for flagging heavy requests or jobs. These thresholds determine when a request or job is considered to have exceeded acceptable SQL activity. ```ruby Coverband.configure do |config| config.track_query_bursts = true # Thresholds used to flag heavy requests/jobs config.query_burst_query_count_threshold = 30 config.query_burst_sql_time_threshold_ms = 100.0 end ``` -------------------------------- ### Run Coverband Coverage Rake Task Source: https://github.com/danmayer/coverband/blob/main/README.md Run the rake task to report runtime Coverband code coverage. ```bash rake coverband:coverage ``` -------------------------------- ### Troubleshooting Authentication Failed Error Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md If authentication fails with a 401 Unauthorized error, verify that the Authorization header is correctly set with a valid Bearer token. ```text 401 Unauthorized - Authentication required ``` -------------------------------- ### Configure Coverband with Redis Store Source: https://github.com/danmayer/coverband/blob/main/README.md Set up Coverband to use Redis for storing coverage data. Ensure Redis is accessible via the specified URL or environment variables. This configuration also sets up logging and enables verbose mode for debugging. ```ruby # config/coverband.rb NOT in the initializers Coverband.configure do |config| config.store = Coverband::Adapters::RedisStore.new(Redis.new(url: ENV['MY_REDIS_URL'])) config.logger = Rails.logger # config options false, true. (defaults to false) # true and debug can give helpful and interesting code usage information # and is safe to use if one is investigating issues in production, but it will slightly # hit perf. config.verbose = false # default false. button at the top of the web interface which clears all data config.web_enable_clear = true # default false. Experimental support for routes usage tracking. config.track_routes = true end ``` -------------------------------- ### Standalone MCP HTTP Server Deployment Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Deploy Coverband's MCP as a standalone HTTP server. Ensure environment variables for password and allowed environments are set. ```ruby # script/mcp_server.rb require 'coverband/mcp' Coverband.configure do |config| config.mcp_enabled = true config.mcp_password = ENV['COVERBAND_MCP_PASSWORD'] config.mcp_allowed_environments = %w[production] end server = Coverband::MCP::Server.new server.run_http(port: 9023, host: "127.0.0.1") # Bind to localhost only ``` -------------------------------- ### Force Runtime Coverage After Eager Loading Source: https://github.com/danmayer/coverband/blob/main/README.md If eager loading is manually called during initialization, immediately follow with Coverband's reporting and runtime coverage calls. This ensures accurate tracking after modifications to the Rails initialization process. ```ruby Rails.application.routes.draw do ResqueWeb::Engine.eager_load! Coverband.report_coverage Coverband.runtime_coverage! end ``` -------------------------------- ### Configure Redis Hash Store Source: https://github.com/danmayer/coverband/blob/main/README.md Use Redis Hash Store to resolve race conditions and reduce Ruby memory overhead on high-volume sites. This requires adjusting Redis instance accordingly. ```ruby config.store = Coverband::Adapters::HashRedisStore.new(Redis.new(url: redis_url)) ``` -------------------------------- ### Add MCP Gem to Gemfile Source: https://github.com/danmayer/coverband/blob/main/README.md Include the MCP gem in your Gemfile to enable the Model Context Protocol server for AI assistants. ```ruby gem 'mcp' ``` -------------------------------- ### Enable Oneshot Lines Coverage Source: https://github.com/danmayer/coverband/blob/main/README.md Enable oneshot mode to reduce Ruby CPU overhead. This provides execution data but not frequency counts. ```ruby config.use_oneshot_lines_coverage = true ``` -------------------------------- ### Auto-fix Style Issues with StandardRB Source: https://github.com/danmayer/coverband/blob/main/agents.md Automatically fix code style issues detected by StandardRB. Run this after making code changes to ensure compliance. ```bash bundle exec standardrb --fix ``` -------------------------------- ### Enable ViewComponent Instrumentation Source: https://github.com/danmayer/coverband/blob/main/README.md Enable instrumentation for ViewComponent renders in your Rails application's configuration. This allows Coverband to track which ViewComponent templates are rendered, provided ViewComponent version is >= 4.6.0. ```ruby # config/application.rb (or environment-specific config) config.view_component.instrumentation_enabled = true ``` -------------------------------- ### Configure Redis with TLS using ENV variable Source: https://github.com/danmayer/coverband/blob/main/README.md Set the REDIS_URL environment variable to use the 'rediss://' scheme for TLS-enabled Redis instances, such as AWS ElastiCache. ```bash REDIS_URL=rediss://my-elasticache.abcdef.cache.amazonaws.com:6379 ``` -------------------------------- ### Debug Redis Store: Coverage Data Source: https://github.com/danmayer/coverband/blob/main/README.md Inspect the coverage data currently stored in Redis. ```ruby Coverband.configuration.store.coverage ``` -------------------------------- ### SimpleCov Coverage Format Source: https://github.com/danmayer/coverband/blob/main/docs/internal_formats.md Represents coverage data in a format similar to SimpleCov, using relative paths and an array of line coverage counts. This format is useful for compatibility with SimpleCov reporting tools. ```json {"test/unit/dog.rb"=>[1, 2, nil, nil, nil, nil, nil]} ``` -------------------------------- ### Fix Coverage Reporting as Loading Hits Source: https://github.com/danmayer/coverband/blob/main/README.md Manually switch Coverband to runtime coverage if initialization hooks fail, causing all coverage to be counted as 'loading' or 'eager_loading'. This is often necessary when plugins or gems alter the Rails initialization process. ```ruby config.after_initialize do unless Coverband.tasks_to_ignore? Coverband.report_coverage # record the last of the loading coverage Coverband.runtime_coverage! # set all future coverage to runtime end end ``` -------------------------------- ### Run Forked Tests with Rake Source: https://github.com/danmayer/coverband/blob/main/agents.md Execute tests that require forked processes, such as Rails integration tests. Note: Not supported on JRuby. ```bash bundle exec rake forked_tests ``` -------------------------------- ### Check Rails Defined Status Correctly Source: https://github.com/danmayer/coverband/blob/main/agents.md Safely check if the Rails constant is defined and responds to methods. Avoids errors with undefined constants. ```ruby # ✅ Correct if defined?(Rails) && Rails.respond_to?(:version) # ... end # ❌ Wrong (doesn't protect against undefined constant) if Rails&.respond_to?(:version) # ... end ``` -------------------------------- ### Adjust Background Reporting Sleep Seconds Source: https://github.com/danmayer/coverband/blob/main/README.md Adjust the background reporting frequency to help reduce extra Redis load when using Redis Hash Store. The default is 30 seconds. ```ruby config.background_reporting_sleep_seconds = 120 ``` -------------------------------- ### Run Dead Method Scanning Rake Task Source: https://github.com/danmayer/coverband/blob/main/README.md Execute the 'dead_methods' rake task to identify methods that are not covered by tests based on current coverage data. Requires Ruby 2.6+. ```bash bundle exec rake coverband:dead_methods ``` -------------------------------- ### SSH Tunnel for Secure Remote MCP Access Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Establish a secure SSH tunnel to access the production MCP server from a development machine. ```bash # Create secure tunnel to production MCP server ssh -L 9023:localhost:9023 production-server # Now access MCP locally via tunnel curl -H "Authorization: Bearer your-mcp-password" \ -H "Content-Type: application/json" \ -X POST http://localhost:9023/mcp \ -d '{"method":"tools/list"}' ``` -------------------------------- ### Hide Coverband Settings View Source: https://github.com/danmayer/coverband/blob/main/README.md Disable the visibility of Coverband's current settings in the UI. This is useful when sharing coverage data with a wider audience where access to configuration details might be restricted. ```ruby config.hide_settings = true ``` -------------------------------- ### Nginx Reverse Proxy Configuration for MCP Source: https://github.com/danmayer/coverband/blob/main/docs/mcp_security.md Configure Nginx as a reverse proxy for the MCP server, adding HTTP Basic Auth and rate limiting. ```nginx # nginx configuration location /mcp { # Additional HTTP Basic Auth layer auth_basic "Coverband MCP"; auth_basic_user_file /etc/nginx/.htpasswd; # Rate limiting limit_req zone=mcp burst=10; # Proxy to MCP server proxy_pass http://localhost:9023/mcp; proxy_set_header Authorization "Bearer ${COVERBAND_MCP_PASSWORD}"; } ``` -------------------------------- ### Resolve Stack Level Too Deep Errors Source: https://github.com/danmayer/coverband/blob/main/README.md Modify the Gemfile to specify an alternative patch for Coverband if stack level too deep errors occur due to conflicts with other patches like ResqueWorker. ```ruby gem 'coverband', require: ['alternative_coverband_patch', 'coverband'] ``` ```ruby gem 'coverband', require: ['alternative_coverband_patch'] ``` -------------------------------- ### Require Coverband Tasks for Non-Rails Apps Source: https://github.com/danmayer/coverband/blob/main/README.md For non-Rails apps, require Coverband and its tasks in your Rakefile to use the available rake commands. ```ruby require 'coverband' Coverband.configure require 'coverband/utils/tasks' ``` -------------------------------- ### Ignore Custom Gem Locations Source: https://github.com/danmayer/coverband/blob/main/README.md Add custom gem locations, such as 'app/gems', to the ignore list if they are not in the default ignored directories. This prevents coverage from being reported on gems stored in non-standard locations within your application. ```ruby config.ignore += ['gems/*'] ``` -------------------------------- ### Clear All Coverband Data Source: https://github.com/danmayer/coverband/blob/main/README.md Clear both coverage and trackers data using the rake task. This is useful for testing or debugging. ```bash rake coverband:clear ``` -------------------------------- ### Clear Only Coverage Data Source: https://github.com/danmayer/coverband/blob/main/README.md Clear only the coverage data using the rake task. ```bash rake coverband:clear_coverage ``` -------------------------------- ### Clear Only Trackers Data Source: https://github.com/danmayer/coverband/blob/main/README.md Clear only the trackers data using the rake task. ```bash rake coverband:clear_tracker ``` -------------------------------- ### Disable View Tracking Source: https://github.com/danmayer/coverband/blob/main/README.md Turn off Coverband's view tracking feature by setting `config.track_views` to `false`. This feature is enabled by default and tracks the usage of view files within your application. ```ruby config.track_views = false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.