Class: Soba::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Dry::Configurable
Defined in:
lib/soba/configuration.rb

Class Method Summary collapse

Class Method Details

.load!(path: nil) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/soba/configuration.rb', line 93

def load!(path: nil)
  config_path = find_config_file(path)

  if config_path && File.exist?(config_path)
    load_from_file(config_path)
  else
    create_default_config(config_path || default_config_path)
  end

  validate!
  config
end

.reset_configObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/soba/configuration.rb', line 62

def reset_config
  @config = nil
  configure do |c|
    c.github.token = ENV.fetch('GITHUB_TOKEN', nil)
    c.github.repository = nil
    c.github.auth_method = nil
    c.workflow.interval = 20
    c.workflow.use_tmux = true
    c.workflow.auto_merge_enabled = true
    c.workflow.closed_issue_cleanup_enabled = true
    c.workflow.closed_issue_cleanup_interval = 300
    c.workflow.tmux_command_delay = 3
    c.slack.webhook_url = nil
    c.slack.notifications_enabled = false
    c.git.worktree_base_path = '.git/soba/worktrees'
    c.git.setup_workspace = true
    c.phase.plan.command = nil
    c.phase.plan.options = []
    c.phase.plan.parameter = nil
    c.phase.implement.command = nil
    c.phase.implement.options = []
    c.phase.implement.parameter = nil
    c.phase.review.command = nil
    c.phase.review.options = []
    c.phase.review.parameter = nil
    c.phase.revise.command = nil
    c.phase.revise.options = []
    c.phase.revise.parameter = nil
  end
end