Module: OllamaChat::EnvConfig

Includes:
ConstConf
Defined in:
lib/ollama_chat/env_config.rb

Defined Under Namespace

Modules: OLLAMA

Constant Summary collapse

XDG_CONFIG_HOME =
set do
  description 'XDG Configuration directory path'
  default { '~/.config' }
  decode  { Pathname.new(_1) + 'ollama_chat' }
end
XDG_CACHE_HOME =
set do
  description 'XDG Cache directory path'
  default { '~/.cache' }
  decode  { Pathname.new(_1) + 'ollama_chat' }
end
PAGER =
set do
  description 'Pager command to use in case terminal lines are exceeded by output'

  default do
    if fallback_pager = `which less`.full?(:chomp) || `which more`.full?(:chomp)
      fallback_pager << ' -r'
    end
  end
end
DIFF_TOOL =
set do
  description 'Diff tool to apply changes with'

  default do
    if  diff = `which vimdiff`.full?(:chomp)
      diff
    else
      warn 'Need a diff tool configured via env var "DIFF_TOOL"'
    end
  end
end
KRAMDOWN_ANSI_OLLAMA_CHAT_STYLES =
set do
  description 'Styles to use for kramdown-ansi markdown'

  default ENV['KRAMDOWN_ANSI_STYLES'].full?
end