Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f/guardian
Guardian watches over your files and run assigned tasks.
https://github.com/f/guardian
Last synced: 18 days ago
JSON representation
Guardian watches over your files and run assigned tasks.
- Host: GitHub
- URL: https://github.com/f/guardian
- Owner: f
- License: mit
- Created: 2016-01-01T13:50:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T13:17:15.000Z (about 1 year ago)
- Last Synced: 2024-11-09T18:51:48.753Z (about 1 month ago)
- Language: Crystal
- Homepage: http://f.github.io/guardian
- Size: 824 KB
- Stars: 276
- Watchers: 9
- Forks: 23
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - guardian - File change watcher for Crystal and Non-Crystal libs (Development Tools)
README
# 💂 Guardian.cr
Guardian watches over your files and runs assigned tasks.
![Guardian](http://i.imgur.com/mUzv2DL.gif)
## Installation
### OS X
```bash
brew tap f/guardian
brew install guardian
```### Arch Linux
Guardian is availabe as a package from the Arch User Repository
called [guardian-git](https://aur.archlinux.org/packages/guardian-git/)### From Source
```bash
git clone https://github.com/f/guardian.git && cd guardian
crystal build src/guardian.cr --release
```## Quickstart
### Crystal Libs
Guardian works seamless with Crystal Projects. It automatically binds itself to
library you use.```bash
$ crystal init lib yourlib
$ cd yourlib
$ guardian --init
Created guardian.yml of ./src/yourlib.cr
```### Non-Crystal Libs
You can use Guardian for other projects.
```bash
$ guardian --init
Created guardian.yml
```## Usage
```bash
$ guardian --init
```It will create a `guardian.yml` file to use by Guardian.
## `guardian.yml`
`guardian.yml` is a simple YAML file.
Simply it has **YAML documents** with seperated by `---` line and each document has
`files` and `run` keys.`files` key needs a glob pattern, and `run` is a shell command what to run.
```yaml
files: ./**/*.cr
run: crystal build ./src/guardian.cr
---
files: ./shard.yml
run: shards install
```### `%file%` Variable
Guardian replaces `%file%` variable in commands with the changed file.
```yaml
files: ./**/*.txt
run: echo "%file% is changed"
```Think you have a `hello.txt` in your directory, and Guardian will run `echo "hello.txt is changed"` command when it's changed.
## Running Guardian
```bash
$ guardian
💂 Guardian is on duty!
```## Contributing
1. Fork it ( https://github.com/f/guardian/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
- [f](https://github.com/f) Fatih Kadir Akın - creator, maintainer