https://github.com/tijn/xdg_base_directory
A Crystal implementation of the XDG Base Directory specs
https://github.com/tijn/xdg_base_directory
Last synced: about 1 year ago
JSON representation
A Crystal implementation of the XDG Base Directory specs
- Host: GitHub
- URL: https://github.com/tijn/xdg_base_directory
- Owner: tijn
- License: gpl-3.0
- Created: 2017-10-28T22:21:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T07:59:19.000Z (about 2 years ago)
- Last Synced: 2025-05-06T23:16:49.423Z (about 1 year ago)
- Language: Crystal
- Size: 33.2 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xdg_base_directory
An implementation of the XDG Base Directory specs in Crystal-lang
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
xdg_base_directory:
github: tijn/xdg_base_directory
```
## Usage
```crystal
require "xdg_base_directory"
xdg_dirs = XdgBaseDirectory.app_directories("my-awesome-app")
settings = xdg_dirs.config.read_file("settings.ini")
xdg_dirs.config.write_file("settings.ini.backup", setttings)
# open the cache directory
xdg_dirs.cache.to_dir # returns a Dir instance
# open the runtime directory
xdg_dirs.runtime_dir.to_dir # returns a Dir instance
```
## Contributing
1. Fork it ( https://github.com/tijn/xdg_base_directory/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [tijn](https://github.com/tijn) Tijn Schuurmans - creator, maintainer