Class: Serialbench::CLI

Inherits:
Serialbench::Cli::BaseCli show all
Defined in:
lib/serialbench/cli.rb

Overview

Main CLI entry point for the new object-oriented command structure

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Serialbench::Cli::BaseCli

exit_on_failure?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args) ⇒ Object

Handle unknown commands gracefully



80
81
82
83
84
85
# File 'lib/serialbench/cli.rb', line 80

def method_missing(method_name, *_args)
  puts "Unknown command: #{method_name}"
  puts ''
  help
  exit 1
end

Class Method Details

.versionObject



30
31
32
# File 'lib/serialbench/cli.rb', line 30

def self.version
  puts "Serialbench version #{Serialbench::VERSION}"
end

Instance Method Details

#help(command = nil) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/serialbench/cli.rb', line 35

def help(command = nil)
  if command
    super(command)
  else
    puts <<~HELP
      Serialbench - Benchmarking Framework for Ruby Serialization Libraries

      USAGE:
        serialbench COMMAND [SUBCOMMAND] [OPTIONS]

      COMMANDS:
        environment   Manage benchmark environments (Docker, ASDF, Local)
        benchmark     Manage individual benchmark runs
        resultset     Manage benchmark resultsets (collections of runs)
        ruby-build    Manage Ruby-Build definitions for validation
        version       Show version information
        help          Show this help message

      EXAMPLES:
        # Create a Docker environment
        serialbench environment new docker-test docker

        # Run multi-environment benchmarks
        serialbench environment multi-execute asdf --config=serialbench-asdf.yml
        serialbench environment multi-execute docker --config=serialbench-docker.yml

        # Create and execute a benchmark
        serialbench benchmark create my-benchmark
        serialbench benchmark execute my-benchmark.yml

        # Create a result set for comparison
        serialbench resultset create comparison-set
        serialbench resultset add-result comparison-set results/my-benchmark

        # Generate static sites
        serialbench benchmark build-site results/my-benchmark
        serialbench resultset build-site resultsets/comparison-set

      For detailed help on any command, use:
        serialbench COMMAND help
    HELP
  end
end

#respond_to_missing?(_method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/serialbench/cli.rb', line 87

def respond_to_missing?(_method_name, _include_private = false)
  false
end