Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pry_wrapper.rb to be XDG compliant #962

Merged

Conversation

quintrino
Copy link
Contributor

The XDG Base Directory Specification (which is currently used by
FOSS projects such as Git, Tmux, Pry, Rspec) provides a default
location for various file formats, including config/rc/history files.

This comment refactors pry_wrapper.rb to load GUARD_RC and
HISTORY_FILE from XDG_CONFIG_HOME and XDG_DATA_HOME
respectively if they are both set and the corresponding files exist
within the guard subdirectory within the XDG locations.

To maintain backwards compatibility it defaults back to ~/.guardrc
and ~/.guard_history if the respective XDG environment variable does
not exist or there is no corresponding file.

The XDG Base Directory Specification (which is currently used by
FOSS projects such as Git, Tmux, Pry, Rspec) provides a default
location for various file formats, including config/rc/history files.

This comment refactors pry_wrapper.rb to load GUARD_RC and
HISTORY_FILE from XDG_CONFIG_HOME and XDG_DATA_HOME
respectively if they are both set and the corresponding files exist
within the guard subdirectory within the XDG locations.

To maintain backwards compatibility it defaults back to ~/.guardrc
and ~/.guard_history if the respective XDG environment variable does
not exist or there is no corresponding file.
@codecov
Copy link

codecov bot commented May 24, 2020

Codecov Report

Merging #962 into master will decrease coverage by 0.07%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #962      +/-   ##
==========================================
- Coverage   88.77%   88.69%   -0.08%     
==========================================
  Files          58       58              
  Lines        2004     2008       +4     
==========================================
+ Hits         1779     1781       +2     
- Misses        225      227       +2     
Impacted Files Coverage Δ
lib/guard/jobs/pry_wrapper.rb 80.24% <66.66%> (-0.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32e2d7f...0342602. Read the comment docs.

@rymai rymai added the ✨ Feature Adds a new feature label May 25, 2020
@rymai rymai self-assigned this May 25, 2020
@rymai
Copy link
Member

rymai commented May 25, 2020

@quintrino Thank you, looks good to me! ☀️ 🚀

@rymai rymai merged commit 24e865c into guard:master May 25, 2020
rymai pushed a commit that referenced this pull request May 13, 2021
The XDG Base Directory Specification (which is currently used by
FOSS projects such as Git, Tmux, Pry, Rspec) provides a default
location for various file formats, including config/rc/history files.

This comment refactors pry_wrapper.rb to load GUARD_RC and
HISTORY_FILE from XDG_CONFIG_HOME and XDG_DATA_HOME
respectively if they are both set and the corresponding files exist
within the guard subdirectory within the XDG locations.

To maintain backwards compatibility it defaults back to ~/.guardrc
and ~/.guard_history if the respective XDG environment variable does
not exist or there is no corresponding file.
This was referenced May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants