Class: SimpleCovMcp::Commands::VersionCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/simplecov_mcp/commands/version_command.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#cli, #config, #source_formatter

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from SimpleCovMcp::Commands::BaseCommand

Instance Method Details

#execute(_args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/simplecov_mcp/commands/version_command.rb', line 10

def execute(_args)
  @gem_root = File.expand_path('../../..', __dir__)

  if config.format == :table
    data = {
      'Version' => SimpleCovMcp::VERSION,
      'Gem Root' => @gem_root,
      'Documentation' => 'README.md and docs/user/**/*.md in gem root'
    }
    puts TableFormatter.format_vertical(data)
  else
    puts SimpleCovMcp::Formatters.format(version_info, config.format)
  end
end