Respect XDG basedir spec

Abierto
#1,031 9 comentarios 4 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
cli, tooling

Línea de trabajo

Start by locating how rdbg_history, rdbgrc, and unix_domain_socket_dir are currently resolved, then compare those locations with the XDG Base Directory Specification. Define the appropriate XDG state, config, and runtime locations, including defaults, and verify that all three files or directories follow the selected behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

Your proposal
I propose that debug respect the XDG Base Directory Specification such that files are written to locations controlled by user environment variables.

There are at least three relevant files:

  • rdbg_history
  • rdbgrc
  • unix_domain_socket_dir

Presently, the history file may be forced into a different location with the RUBY_DEBUG_HISTORY_FILE env var. While helpful, this does not adhere to the desire for single-configuration (setting XDG_* vars once and not needing to configure each of hundreds of different utilities). It should default to a file or directory in XDG_STATE_HOME (which itself defaults to $HOME/.local/state)

The unix_domain_socket_dir is already very nearly adhering to Xdg, as its first implicit location (after checking explicit config setting) uses XDG_RUNTIME_DIR.

The rdbgrc (and .rb variant) have no env var equivalents and so cannot even be set explicitly. However, they should be using files within XDG_CONFIG_HOME (which defaults to $HOME/.config). Perhaps $XDG_CONFIG_HOME/rdbg/config or $XDG_CONFIG_HOME/rdbg/config.rb ?

Additional context
The Xdg basedir spec is here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Rationale

  • keeps user's homedirectory clean
  • allows versioning of configuration files cleanly (ie, dotfiles repo to version-control .config but not cache or data files that also typically end up in homedir)
  • allows single-configuration changes to move configuration to different directory tree (for testing, for simulated environments, and many other unknowable use-cases)
Lenguaje dominante
Ruby
Estrellas
1.3k
Forks
146
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ruby/debug

Todos los issues de ruby/debug

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.