[
  {
    "path": ".github/workflows/crystal.yml",
    "content": "name: Crystal CI\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n  schedule:\n    - cron: '0 5 * * 0'\n\njobs:\n  build:\n\n    runs-on: ubuntu-latest\n\n    container:\n      image: crystallang/crystal\n\n    steps:\n    - uses: actions/checkout@v2\n    - name: Install dependencies\n      run: shards install\n    - name: Run build\n      run: crystal build src/guardian.cr\n"
  },
  {
    "path": ".gitignore",
    "content": "/doc/\n/libs/\n/.crystal/\n/.shards/\nguardian\n\n\n# Libraries don't need dependency lock\n# Dependencies will be locked in application that uses them\n/shard.lock\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: crystal\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Fatih Kadir Akın\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# 💂 Guardian.cr\n\nGuardian watches over your files and runs assigned tasks.\n\n![Guardian](http://i.imgur.com/mUzv2DL.gif)\n\n## Installation\n\n### OS X\n\n```bash\nbrew tap f/guardian\nbrew install guardian\n```\n\n### Arch Linux\n\nGuardian is availabe as a package from the Arch User Repository \ncalled [guardian-git](https://aur.archlinux.org/packages/guardian-git/)\n\n### From Source\n\n```bash\ngit clone https://github.com/f/guardian.git && cd guardian\ncrystal build src/guardian.cr --release\n```\n\n## Quickstart\n\n### Crystal Libs\n\nGuardian works seamless with Crystal Projects. It automatically binds itself to\nlibrary you use.\n\n```bash\n$ crystal init lib yourlib\n$ cd yourlib\n$ guardian --init\nCreated guardian.yml of ./src/yourlib.cr\n```\n\n### Non-Crystal Libs\n\nYou can use Guardian for other projects.\n\n```bash\n$ guardian --init\nCreated guardian.yml\n```\n\n## Usage\n\n```bash\n$ guardian --init\n```\n\nIt will create a `guardian.yml` file to use by Guardian.\n\n## `guardian.yml`\n\n`guardian.yml` is a simple YAML file.\n\nSimply it has **YAML documents** with seperated by `---` line and each document has\n`files` and `run` keys.\n\n`files` key needs a glob pattern, and `run` is a shell command what to run.\n\n```yaml\nfiles: ./**/*.cr\nrun: crystal build ./src/guardian.cr\n---\nfiles: ./shard.yml\nrun: shards install\n```\n\n### `%file%` Variable\n\nGuardian replaces `%file%` variable in commands with the changed file.\n\n```yaml\nfiles: ./**/*.txt\nrun: echo \"%file% is changed\"\n```\n\nThink you have a `hello.txt` in your directory, and Guardian will run `echo \"hello.txt is changed\"` command when it's changed.\n\n## Running Guardian\n\n```bash\n$ guardian\n💂 Guardian is on duty!\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/f/guardian/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [f](https://github.com/f) Fatih Kadir Akın - creator, maintainer\n"
  },
  {
    "path": "guardian.yml",
    "content": "files: ./**/*.cr\nrun: crystal build ./src/guardian.cr\n---\nfiles: ./shard.yml\nrun: shards install\n"
  },
  {
    "path": "install.sh",
    "content": "#!/bin/bash\n\n# for linux users\ncp ./guardian /usr/bin/guardian"
  },
  {
    "path": "shard.yml",
    "content": "name: guardian\nversion: 0.0.6\n\nauthors:\n  - Fatih Kadir Akın <fakin@protel.com.tr>\n  - f1refly <f1refly@airmail.cc>\n\ntargets:\n  guardian:\n    main: src/guardian.cr\n\ncrystal: 0.35.1\n\nlicense: MIT\n"
  },
  {
    "path": "spec/guardian.cr",
    "content": "require \"./spec_helper\"\n\ndescribe Guardian do\n  # TODO: Write tests\n\n  it \"works\" do\n    true.should eq(true)\n  end\nend\n"
  },
  {
    "path": "spec/spec_helper.cr",
    "content": "require \"spec\"\nrequire \"../src/guardian\"\n"
  },
  {
    "path": "src/guardian.cr",
    "content": "require \"./guardian/*\"\nrequire \"option_parser\"\nrequire \"colorize\"\n\nignore_executables = true\nclear_on_action = false\ncase ARGV[0]?\nwhen \"init\"\n  puts \"\\\"init\\\" has been deprecated please use: -i or --init\"\n  Guardian::Generator.new.generate\n  exit\nelse\n  OptionParser.parse do |options|\n    options.on \"-i\", \"--init\", \"Generates the guardian.yml file\" do\n      Guardian::Generator.new.generate\n      exit\n    end\n\n    options.on \"-v\", \"--version\", \"Shows the version\" do\n      puts \"Guardian (#{Guardian::VERSION})\"\n      exit\n    end\n\n    options.on \"-h\", \"--help\", \"Shows the help\" do\n      puts options\n      exit\n    end\n\n    options.on \"-e\", \"--watch-executables\", \"Include files marked as executable\" do\n      ignore_executables = false\n    end\n\n    options.on \"-nc\", \"--no-colour\", \"Disable coloring of text output\" do\n      Colorize.enabled = false\n    end\n\n    options.on \"-c\", \"--clear\", \"Clear terminal before each action\" do\n      clear_on_action = true\n    end\n\n    options.invalid_option do\n      puts options\n      exit\n    end\n  end\nend\n\nGuardian::Watcher.new ignore_executables, clear_on_action\n"
  }
]