Class: Soba::Commands::Config::Show

Inherits:
Object
  • Object
show all
Defined in:
lib/soba/commands/config/show.rb

Instance Method Summary collapse

Instance Method Details

#execute(config_path: nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/soba/commands/config/show.rb', line 11

def execute(config_path: nil)
  config = Soba::ConfigLoader.load(path: config_path)

  puts "=== soba Configuration ==="
  puts ""
  puts "GitHub:"
  puts "  Repository: #{config.github.repository}"
  puts "  Token: #{mask_token(config.github.token)}"
  puts ""
  puts "Workflow:"
  puts "  Interval: #{config.workflow.interval} seconds"
  puts ""
  puts "Configuration loaded from: #{find_config_path(config_path)}"
rescue Soba::ConfigurationError => e
  Soba.logger.error "Configuration Error: #{e.message}"
  exit 1
end