Class: Serialbench::CLI

Inherits:
Serialbench::Cli::BaseCli
  • Object
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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args) ⇒ Object

Handle unknown commands gracefully



73
74
75
76
77
78
# File 'lib/serialbench/cli.rb', line 73

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

Class Method Details

.versionObject



27
28
29
# File 'lib/serialbench/cli.rb', line 27

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

Instance Method Details

#help(command = nil) ⇒ Object



32
33
34
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
# File 'lib/serialbench/cli.rb', line 32

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
        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

        # Generate static sites
        serialbench benchmark build-site results/my-benchmark

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

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

Returns:

  • (Boolean)


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

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