Class: Makit::Cli::StrategyCommands

Inherits:
Base
  • Object
show all
Defined in:
lib/makit/cli/strategy_commands.rb

Overview

Commands for managing execution strategies

Instance Method Summary collapse

Instance Method Details

#strategyObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/makit/cli/strategy_commands.rb', line 11

def strategy
  runner = Makit::Commands::Runner.default
  info = runner.strategy_info

  puts "Current Execution Strategy:"
  puts "  Type: #{info[:type]}"
  puts "  Class: #{info[:class]}"
  
  if options[:verbose]
    puts "\nFactory Information:"
    factory_info = info[:factory_info]
    puts "  Current: #{factory_info[:current]}"
    puts "  Available: #{factory_info[:available].join(', ')}"
    puts "  ChildProcess Available: #{factory_info[:childprocess_available]}"
    puts "  Open3 Available: #{factory_info[:open3_available]}"
  end

  puts "\nEnvironment Variables:"
  puts "  MAKIT_STRATEGY: #{ENV['MAKIT_STRATEGY'] || 'not set (using auto-detect)'}"
end

#testObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/makit/cli/strategy_commands.rb', line 34

def test
  timeout = options[:timeout].to_i
  
  puts "Testing execution strategies..."
  puts "=" * 50

  # Test ChildProcess strategy
  puts "\n1. Testing ChildProcess Strategy:"
  childprocess_result = test_strategy('childprocess', timeout)
  
  # Test Open3 strategy  
  puts "\n2. Testing Open3 Strategy:"
  open3_result = test_strategy('open3', timeout)

  # Show comparison
  puts "\n" + "=" * 50
  puts "Performance Comparison:"
  puts "  ChildProcess: #{childprocess_result[:duration]}s (#{childprocess_result[:status]})"
  puts "  Open3:       #{open3_result[:duration]}s (#{open3_result[:status]})"
end