pax_global_header 0000666 0000000 0000000 00000000064 14500011231 0014475 g ustar 00root root 0000000 0000000 52 comment=18a24afd04c6b46fa0f50d64dfd07bc2e6be5557
guard-2.18.1/ 0000775 0000000 0000000 00000000000 14500011231 0012670 5 ustar 00root root 0000000 0000000 guard-2.18.1/.github/ 0000775 0000000 0000000 00000000000 14500011231 0014230 5 ustar 00root root 0000000 0000000 guard-2.18.1/.github/release-drafter.yml 0000664 0000000 0000000 00000000746 14500011231 0020027 0 ustar 00root root 0000000 0000000 name-template: "v$NEXT_PATCH_VERSION"
tag-template: "v$NEXT_PATCH_VERSION"
categories:
- title: "⚠️ Breaking Changes"
label: "⚠️ Breaking"
- title: "✨ New Features"
label: "✨ Feature"
- title: "🐛 Bug Fixes"
label: "🐛 Bug Fix"
- title: "📚 Documentation"
label: "📚 Docs"
- title: "🏠 Housekeeping"
label: "🏠 Housekeeping"
change-template: "- $TITLE (#$NUMBER) @$AUTHOR"
no-changes-template: "- No changes"
template: |
$CHANGES
guard-2.18.1/.github/workflows/ 0000775 0000000 0000000 00000000000 14500011231 0016265 5 ustar 00root root 0000000 0000000 guard-2.18.1/.github/workflows/push.yml 0000664 0000000 0000000 00000000433 14500011231 0017767 0 ustar 00root root 0000000 0000000 on: push
name: Push
jobs:
draftRelease:
name: Draft Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Draft Release
uses: toolmantim/release-drafter@v5.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
guard-2.18.1/.gitignore 0000664 0000000 0000000 00000000345 14500011231 0014662 0 ustar 00root root 0000000 0000000 pkg/*
doc/*
*.gem
*.rbc
.*.swp
*.bak
.bundle
bundle
.yardoc
.rbx
.rvmrc
.rbenv-version
.idea
Gemfile.lock
bin/fsevent_watch_guard
Makefile
.guard_result
coverage/
.ruby-version
.tm_properties
man/guard
man/guard.html
/tags
/tmp/
guard-2.18.1/.hound.yml 0000664 0000000 0000000 00000000062 14500011231 0014604 0 ustar 00root root 0000000 0000000 ruby:
enabled: true
config_file: .rubocop.yml
guard-2.18.1/.rspec 0000664 0000000 0000000 00000000101 14500011231 0013775 0 ustar 00root root 0000000 0000000 --fail-fast
--format documentation
--color
--require spec_helper
guard-2.18.1/.rubocop.yml 0000664 0000000 0000000 00000000474 14500011231 0015147 0 ustar 00root root 0000000 0000000 inherit_from:
- vendor/hound/config/style_guides/ruby.yml
- .rubocop_todo.yml
# Files you want to exclude
AllCops:
TargetRubyVersion: 2.4
Exclude:
- vendor/**/*
- db/schema.rb
- tmp/aruba/Guardfile
- tmp/aruba/Gemfile
- Guardfile
- config/Guardfile
# TODO: put your overrides here:
guard-2.18.1/.rubocop_todo.yml 0000664 0000000 0000000 00000005313 14500011231 0016171 0 ustar 00root root 0000000 0000000 # This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-08-06 16:49:52 +0200 using RuboCop version 0.42.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 9
Lint/NestedMethodDefinition:
Exclude:
- 'lib/guard/commands/all.rb'
- 'lib/guard/commands/change.rb'
- 'lib/guard/commands/notification.rb'
- 'lib/guard/commands/pause.rb'
- 'lib/guard/commands/reload.rb'
- 'lib/guard/commands/scope.rb'
- 'lib/guard/commands/show.rb'
- 'lib/guard/jobs/pry_wrapper.rb'
# Offense count: 7
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb
Rails/Exit:
Exclude:
- 'lib/**/*.rake'
- 'lib/guard.rb'
- 'lib/guard/cli.rb'
- 'lib/tasks/releaser.rb'
# Offense count: 39
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'Rakefile'
- 'lib/guard/dsl.rb'
- 'lib/guard/guardfile.rb'
- 'lib/guard/guardfile/evaluator.rb'
- 'lib/guard/guardfile/generator.rb'
- 'lib/guard/internals/debugging.rb'
- 'lib/guard/internals/groups.rb'
- 'lib/guard/internals/session.rb'
- 'lib/guard/jobs/pry_wrapper.rb'
- 'lib/guard/notifier.rb'
- 'lib/guard/plugin.rb'
- 'lib/guard/plugin_util.rb'
- 'lib/guard/runner.rb'
- 'lib/guard/ui/colors.rb'
- 'lib/guard/version.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'lib/guard/dsl_describer.rb'
- 'lib/guard/terminal.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/SpaceInsideArrayPercentLiteral:
Exclude:
- 'guard.gemspec'
# Offense count: 41
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Layout/SpaceInsideStringInterpolation:
Exclude:
- 'lib/guard.rb'
- 'lib/guard/cli.rb'
- 'lib/guard/commander.rb'
- 'lib/guard/commands/all.rb'
- 'lib/guard/commands/reload.rb'
- 'lib/guard/commands/scope.rb'
- 'lib/guard/dsl.rb'
- 'lib/guard/guardfile/evaluator.rb'
- 'lib/guard/jobs/pry_wrapper.rb'
- 'lib/guard/plugin.rb'
- 'lib/guard/plugin_util.rb'
- 'lib/guard/runner.rb'
- 'lib/guard/ui.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'Rakefile'
guard-2.18.1/.travis.yml 0000664 0000000 0000000 00000000523 14500011231 0015001 0 ustar 00root root 0000000 0000000 language: ruby
rvm:
- 2.4.9
- 2.5.7
- 2.6.5
- 2.7.3
- 3.0.1
- jruby-9.2.8.0
jdk:
- openjdk8
env:
global:
- JRUBY_OPTS="--debug"
script:
- bundle exec rake
bundler_args: --without development
cache: bundler
addons:
code_climate:
repo_token: 185a714e42214b9369217d0ddfd5a02d528d9a616a34482119a16c63241d6afd
guard-2.18.1/.yardopts 0000664 0000000 0000000 00000000333 14500011231 0014535 0 ustar 00root root 0000000 0000000 --title 'Guard Documentation'
--no-private
--embed-mixin ClassMethods
--exclude lib/guard/internals
--readme README.md
--markup markdown
--markup-provider redcarpet
--output-dir ./doc
lib/**/*.rb
-
CHANGELOG.md
LICENSE
guard-2.18.1/CHANGELOG.md 0000664 0000000 0000000 00000000114 14500011231 0014475 0 ustar 00root root 0000000 0000000 # Moved to [Github releases](https://github.com/guard/guard/releases) page.
guard-2.18.1/CONTRIBUTING.md 0000664 0000000 0000000 00000007220 14500011231 0015122 0 ustar 00root root 0000000 0000000 Contribute to Guard
===================
File an issue
-------------
Please check guard's [GitHub issue tracker](https://github.com/guard/guard/issues) for known issues. Additionally you should check [listen's issue tracker](https://github.com/guard/listen/issues) for issues which affect guard's behaviour; for example, there is currently a nasty [bug preventing listen from watching files inside symlinked directories](https://github.com/guard/listen/issues/25).
You can report bugs and feature requests to [GitHub Issues](https://github.com/guard/guard/issues).
**Please don't ask question in the issue tracker**, instead ask them at one of our other places:
* Use the guard tag at [StackOverflow](http://stackoverflow.com/questions/tagged/guard).
* [Google+ community](https://plus.google.com/u/1/communities/110022199336250745477)
* [Google group](http://groups.google.com/group/guard-dev)
* IRC channel `#guard` (irc.freenode.net) for chatting
Try to figure out where the issue belongs to: is it an issue with Guard itself or with a Guard plugin you're using (e.g. guard-rspec, guard-cucumber, etc.)?
When you file a bug, please try to follow these simple rules if applicable:
* Make sure you've read the README carefully.
* Make sure you run Guard with `bundle exec` first.
* Add debug information to the issue by running Guard with the `--debug` option
* Add your `Guardfile` and `Gemfile` to the issue.
* Provide information about your environment:
* Your current versions of your OS, Ruby, Rubygems and Bundler.
* Shared project folder with services like Dropbox, NFS, etc.
* Make sure that the issue is reproducible with your description.
* If Guard is not responding to file changes and/or is not firing rules correctly:
* see [listen](http://github.com/guard/listen) for more info on troubleshooting.
* run guard with the `LISTEN_GEM_DEBUGGING` environment variable set to 1 (info) or 2 (debug) which shows what's happening under the hood and how fast)
* If you are using plugins, check out their respective README files (disabling spring, adding bundle to plugin's command, special debug options, etc.)
**It's most likely that your bug gets resolved faster if you provide as much information as possible!**
Development
-----------
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/guard/master/frames).
* Source hosted at [GitHub](https://github.com/guard/guard).
* The [wiki](https://github.com/guard/guard/wiki/) has useful developer documentation, including:
* [how to create a guard plugin](https://github.com/guard/guard/wiki/Create-a-guard), and
* [understanding Guard](https://github.com/guard/guard/wiki/Understanding-Guard),
which contains useful debugging tips.
Pull requests are very welcome! Please try to follow these simple rules if applicable:
* Please create a topic branch for every separate change you make.
* TIP: run `rubocop` locally before pushing (so your PR won't trigger HoundCI comments)
* Make sure your patches are well tested. All specs must pass when run on [Travis CI](https://travis-ci.org/guard/guard).
* Update the [Yard](http://yardoc.org/) documentation.
* Update the [README](https://github.com/guard/guard/blob/master/README.md).
* Please **do not change** the version number.
The title of your PR will automatically be included in the release notes for the next version of the gem. A maintainer can add one of the following GitHub labels to the PR to automatically categorize it when the release notes are generated:
- ⚠️ Breaking
- ✨ Feature
- 🐛 Bug Fix
- 📚 Docs
- 🏠 Housekeeping
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
`#guard` (irc.freenode.net).
guard-2.18.1/Gemfile 0000664 0000000 0000000 00000002712 14500011231 0014165 0 ustar 00root root 0000000 0000000 # frozen_string_literal: true
source "https://rubygems.org"
gemspec unless ENV["USE_INSTALLED_GUARD"] == "1"
gem "rake"
# The development group will not be
# installed on Travis CI.
group :development do
# Force rubocop local runs to match HoundCI rubocop version
# (https://github.com/houndci/linters/blob/master/Gemfile.lock).
#
# This needs to be manually updated until there's a resolution
# on HoundCI's side.
#
# See https://github.com/houndci/hound/issues/1250
gem "rubocop", "0.54.0", require: false
gem "guard-rubocop", require: false
gem "guard-ronn", require: false, platform: :mri
gem "redcarpet", require: false, platform: :mri
gem "yard", require: false, platform: :mri
# Used for release
gem "gems", require: false, platform: :mri
gem "netrc", require: false, platform: :mri
gem "octokit", require: false, platform: :mri
end
# The test group will be
# installed on Travis CI
#
group :test do
# Both guard-rspec and guard-cucumber are used by cucumber features
gem "guard-cucumber", "~> 2.1", require: false
gem "guard-rspec", require: false
gem "aruba", "~> 0.14", require: false
gem "notiffany", ">= 0.0.6", require: false
gem "rspec", ">= 3.0.0", require: false
gem "simplecov", "~> 0.17", require: false
end
# Needed for Travis
# See http://docs.travis-ci.com/user/languages/ruby/#Rubinius
#
platforms :rbx do
gem "json"
gem "psych"
gem "racc"
gem "rubinius-coverage"
# gem "rubysl", "~> 2.0"
end
guard-2.18.1/Guardfile 0000777 0000000 0000000 00000000000 14500011231 0017602 2config/Guardfile ustar 00root root 0000000 0000000 guard-2.18.1/LICENSE 0000664 0000000 0000000 00000002110 14500011231 0013667 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2009-2016 Thibaud Guillaume-Gentil
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
guard-2.18.1/README.md 0000664 0000000 0000000 00000020572 14500011231 0014155 0 ustar 00root root 0000000 0000000 # Guard
**IMPORTANT: Please upgrade to Ruby >= 2.4 before installing Guard! To install for older versions, update Bundler at least 1.12: `gem update bundler` and Bundler should correctly resolve to earlier gems for your given Ruby version.**
- [Ruby 2.1 is officially outdated and unsupported!](https://www.ruby-lang.org/en/news/2016/03/30/ruby-2-1-9-released/)
- [Ruby 2.2 is officially outdated and unsupported!](https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/)
- [Ruby 2.3 is officially outdated and unsupported!](https://www.ruby-lang.org/en/news/2019/03/31/support-of-ruby-2-3-has-ended/)
:exclamation: Guard is currently accepting more maintainers. Please [read this](https://github.com/guard/guard/wiki/Maintainers) if you're interested in joining the team.
[](https://rubygems.org/gems/guard) [](https://travis-ci.org/guard/guard) [](https://codeclimate.com/github/guard/guard) [](https://codeclimate.com/github/guard/guard) [](http://inch-ci.org/github/guard/guard) [](https://houndci.com)
Guard automates various tasks by running custom rules whenever file or directories are modified.
It's frequently used by software developers, web designers, writers and other specialists to avoid mundane, repetitive actions and commands such as "relaunching" tools after changing source files or configurations.
Common use cases include: an IDE replacement, web development tools, designing "smart" and "responsive" build systems/workflows, automating various project tasks and installing/monitoring various system services.
For a full categorized list of known Guard plugins, look here: https://github.com/guard/guard/wiki/Guard-Plugins
If you have
any questions about Guard or want to share some information with the Guard community, please go to one of
the following places:
* [Guard Wiki](https://github.com/guard/guard/wiki)
* [Google+ community](https://plus.google.com/communities/110022199336250745477).
* [Google group](http://groups.google.com/group/guard-dev).
* [StackOverflow](http://stackoverflow.com/questions/tagged/guard).
* IRC channel `#guard` (irc.freenode.net) for chatting.
Before you file an issue, make sure you have read the _[known issues](#issues)_ and _[file an issue](#file-an-issue)_ sections that contains some important information.
## Features
* File system changes handled by our awesome [Listen](https://github.com/guard/listen) gem.
* Support for visual system notifications.
* Huge eco-system with [more than 300](https://rubygems.org/search?query=guard-) Guard plugins.
* Tested against the latest Ruby 2.4.x, 2.5.x, 2.6.x, JRuby & Rubinius. See [`.travis-ci.yml`](https://github.com/guard/guard/blob/master/.travis.yml) for the exact versions.
## Screencast
Two nice screencasts are available to help you get started:
* [Guard](http://railscasts.com/episodes/264-guard) on RailsCast.
* [Guard is Your Best Friend](http://net.tutsplus.com/tutorials/tools-and-tips/guard-is-your-best-friend) on Net Tuts+.
## Installation
The simplest way to install Guard is to use [Bundler](http://bundler.io).
Add Guard (and any other dependencies) to a `Gemfile` in your project’s root:
```ruby
group :development do
gem 'guard'
end
```
then install it by running Bundler:
```bash
$ bundle
```
Generate an empty `Guardfile` with:
```bash
$ bundle exec guard init
```
Run Guard through Bundler with:
```bash
$ bundle exec guard
```
If you are on Mac OS X and have problems with either Guard not reacting to file
changes or Pry behaving strange, then you should [add proper Readline support
to Ruby on macOS](https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X).
## Avoiding gem/dependency problems
**It's important that you always run Guard through Bundler to avoid errors.**
If you're getting sick of typing `bundle exec` all the time, try one of the following:
* (Recommended) Running `bundle binstub guard` will create `bin/guard` in your
project, which means running `bin/guard` (tab completion will save you a key
stroke or two) will have the exact same result as `bundle exec guard`.
* Or, you can `alias be="bundle exec"` in your `.bashrc` or similar and the execute only `be guard`.
**Protip**: It will work for all comands executed in `bundle exec` context!
* Or, for RubyGems >= 2.2.0 (at least, though the more recent the better),
simply set the `RUBYGEMS_GEMDEPS` environment variable to `-` (for autodetecting
the Gemfile in the current or parent directories) or set it to the path of your Gemfile.
(To upgrade RubyGems from RVM, use the `rvm rubygems` command).
*NOTE: this Rubygems feature is still under development still lacks many features of bundler*
* Or, for RubyGems < 2.2.0 check out the [Rubygems Bundler](https://github.com/rvm/rubygems-bundler).
## Add Guard plugins
Guard is now ready to use and you should add some Guard plugins for your specific use. Start exploring the many Guard
plugins available by browsing the [Guard organization](https://github.com/guard) on GitHub or by searching for `guard-`
on [RubyGems](https://rubygems.org/search?utf8=%E2%9C%93&query=guard-).
When you have found a Guard plugin of your interest, add it to your `Gemfile`:
```ruby
group :development do
gem ''
end
```
See the init section of the Guard usage below to see how to install the supplied plugin template that you can install and
to suit your needs.
## Usage
Guard is run from the command line. Please open your terminal and go to your project work directory.
Look here for a full [list of Guard commands](https://github.com/guard/guard/wiki/List-of-Guard-Commands)
### Start
Just launch Guard inside your Ruby or Rails project with:
```bash
$ bundle exec guard
```
Guard will look for a `Guardfile` or `guardfile.rb` in your current directory. If it does not find one, it will look
in your `$HOME` directory for a `.Guardfile`.
Please look here to see all the [command line options for Guard](https://github.com/guard/guard/wiki/Command-line-options-for-Guard)
## Interactions
Please read how to [interact with Guard](https://github.com/guard/guard/wiki/Interacting-with-Guard) on the console and which [signals](https://github.com/guard/guard/wiki/Interacting-with-Guard#guard-signals) Guard accepts
## Guardfile DSL
For details on extending your `Guardfile` look at [Guardfile examples](https://github.com/guard/guard/wiki/Guardfile-examples) or look at a list of commands [Guardfile-DSL / Configuring-Guard](https://github.com/guard/guard/wiki/Guardfile-DSL---Configuring-Guard)
## Issues
Before reporting a problem, please read how to [File an issue](https://github.com/guard/guard/blob/master/CONTRIBUTING.md#file-an-issue).
## Development / Contributing
See the [Contributing Guide](https://github.com/guard/guard/blob/master/CONTRIBUTING.md#development).
## Releasing
### Prerequisites
* You must have commit rights to the GitHub repository.
* You must have push rights for rubygems.org.
### How to release
1. Determine which would be the correct next version number according to [semver](http://semver.org/).
1. Update the version in `./lib/guard/version.rb`.
1. Commit the version in a single commit, the message should be "Bump VERSION to X.Y.Z".
1. Push and open a pull request.
1. Once CI is green, merge the pull request.
1. Pull the changes locally and run `bundle exec rake release:full`; this will tag, push to GitHub, publish to rubygems.org, and publish the [release notes](https://github.com/guard/guard/releases) .
### Author
[Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](https://twitter.com/thibaudgg))
### Core Team
* R.I.P. :broken_heart: [Michael Kessler](https://github.com/netzpirat).
* [Rémy Coutable](https://github.com/rymai).
* [Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](https://twitter.com/thibaudgg), [thibaud.gg](https://thibaud.gg/)).
### Contributors
[https://github.com/guard/guard/graphs/contributors](https://github.com/guard/guard/graphs/contributors)
guard-2.18.1/Rakefile 0000664 0000000 0000000 00000003201 14500011231 0014331 0 ustar 00root root 0000000 0000000 require "nenv"
require "bundler/gem_tasks"
require "tasks/releaser"
default_tasks = []
require "rspec/core/rake_task"
default_tasks << RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = Nenv.ci?
end
require "guard/rake_task"
unless defined?(JRUBY_VERSION)
Guard::RakeTask.new(:guard, "--plugin ronn")
end
require "cucumber/rake/task"
Cucumber::Rake::Task.new(:features) do |t|
t.cucumber_opts = "features --format pretty"
t.profile = Nenv.ci? ? 'guard' : 'travis'
end
default_tasks << Struct.new(:name).new(:features)
unless Nenv.ci?
require "rubocop/rake_task"
default_tasks << RuboCop::RakeTask.new(:rubocop)
end
task default: default_tasks.map(&:name)
# Coveralls:
#
# TODO: uncomment to merge results from RSpec and Cucumber
# require "coveralls/rake/task"
# Coveralls::RakeTask.new
# task :default => [:spec, :features, 'coveralls:push']
#
# TODO: for the above to work, also change Coveralls.wear_merged! instead of
# wear! in spec/spec_helper.rb
PROJECT_NAME = "Guard"
CURRENT_VERSION = Guard::VERSION
class GuardReleaser
def self.releaser
@releaser ||= Releaser.new(
project_name: PROJECT_NAME,
gem_name: "guard",
github_repo: "guard/guard",
version: CURRENT_VERSION
)
end
end
namespace :release do
desc "Push #{PROJECT_NAME} #{CURRENT_VERSION} to RubyGems and publish"\
" its GitHub release"
task full: ["release:gem", "release:github"]
desc "Push #{PROJECT_NAME} #{CURRENT_VERSION} to RubyGems"
task :gem do
GuardReleaser.releaser.rubygems
end
desc "Publish #{PROJECT_NAME} #{CURRENT_VERSION} GitHub release"
task :github do
GuardReleaser.releaser.github
end
end
guard-2.18.1/_config.yml 0000664 0000000 0000000 00000000031 14500011231 0015011 0 ustar 00root root 0000000 0000000 theme: jekyll-theme-dinky guard-2.18.1/bin/ 0000775 0000000 0000000 00000000000 14500011231 0013440 5 ustar 00root root 0000000 0000000 guard-2.18.1/bin/_guard-core 0000775 0000000 0000000 00000000330 14500011231 0015551 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
require "guard"
begin
require "guard/aruba_adapter"
rescue LoadError => e
abort "#{e.inspect} - perhaps you need to run using `bundle exec`?"
end
Guard::ArubaAdapter.new(ARGV.dup).execute!
guard-2.18.1/bin/guard 0000775 0000000 0000000 00000004260 14500011231 0014472 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
require "pathname"
class GuardReloader
class Config
def using_rubygems?
ENV["RUBYGEMS_GEMDEPS"]
end
def setup_rubygems_for_deps
require "rubygems"
end
def current_bundler_gemfile
ENV["BUNDLE_GEMFILE"]
end
def using_bundler?
ENV["BUNDLE_GEMFILE"]
end
def setup_bundler_env(gemfile)
ENV["BUNDLE_GEMFILE"] = gemfile
end
def setup_bundler
require "rubygems"
require "bundler/setup"
end
def program_path
Pathname(__FILE__)
end
def program_arguments
ARGV
end
def windows?
Gem.win_platform?
end
def exit_with(code)
exit(code)
end
def spawn_with(*args)
spawn(*args)
end
def wait_ignoring_interrupts(pid)
Process.wait2(pid)[1].exitstatus
rescue Interrupt
retry
rescue Errno::ECHILD
1
end
def exist?(path)
path.exist?
end
def guard_core_path
Gem.bin_path("guard", "_guard-core")
end
end
attr_reader :config
def initialize(config)
@config = config
end
def setup
return config.setup_bundler if config.using_bundler?
return config.setup_rubygems_for_deps if config.using_rubygems?
# No dependency management detected - check if binstubbed by bundler
relative_to_binstub = config.program_path + "../../Gemfile"
if config.exist?(relative_to_binstub)
config.setup_bundler_env(relative_to_binstub.to_s)
config.setup_bundler
return
end
unless config.exist?(Pathname("Gemfile"))
# Running guard with bare ruby here - it's up to the user
# to setup/install missing deps
return
end
STDERR.puts "Warning: you have a Gemfile, but you're not using"\
" bundler or RUBYGEMS_GEMDEPS"
end
def auto_restart
args = [Gem.ruby, config.guard_core_path] + config.program_arguments
loop do
exitcode = config.wait_ignoring_interrupts(config.spawn_with(*args))
config.exit_with(exitcode) if exitcode != 2
end
end
end
unless ENV["GUARD_SPECS_RUNNING"]
config = GuardReloader::Config.new
reloader = GuardReloader.new(config)
reloader.setup
reloader.auto_restart
end
guard-2.18.1/config/ 0000775 0000000 0000000 00000000000 14500011231 0014135 5 ustar 00root root 0000000 0000000 guard-2.18.1/config/Guardfile 0000664 0000000 0000000 00000003021 14500011231 0015756 0 ustar 00root root 0000000 0000000 scope(groups: %w(specs))
directories %w(spec lib config features man)
watch ("config/Guardfile") { UI.info "Exiting guard because config changed"; exit 0 }
group :specs, halt_on_fail: true do
guard :rspec, cmd: "bundle exec rspec", failed_mode: :keep do
require "guard/rspec/dsl"
dsl = Guard::RSpec::Dsl.new(self)
# Feel free to open issues for suggestions and improvements
# RSpec files
rspec = dsl.rspec
watch(rspec.spec_helper) { rspec.spec_dir }
watch(rspec.spec_support) { rspec.spec_dir }
watch(rspec.spec_files)
# Ruby files
ruby = dsl.ruby
dsl.watch_spec_files_for(ruby.lib_files)
# watch("lib/guard/notifier.rb") { "spec/guard/notifiers" }
# watch("lib/guard/interactor.rb") { "spec/guard/commands" }
# watch(%r{^lib/guard/(guard|plugin).rb$}) { "spec/guard/plugin" }
end
guard :rubocop, all_on_start: false, cli: "--rails -c .rubocop.yml" do
watch(%r{.+\.rb$}) { |m| m[0] }
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
guard "cucumber", keep_failed: true, all_on_start: false, cmd_additional_args: '--profile guard' do
watch(%r{^features/.+\.feature$})
watch(%r{^features/support/.+$}) { "features" }
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) do |m|
Dir[File.join("**/#{m[1]}.feature")][0] || "features"
end
end
end
if !defined?(JRUBY_VERSION)
if ENV["CI"] != "true"
group :docs do
guard :ronn do
watch(%r{^man/.+\.ronn?$})
end
end
end
end
guard-2.18.1/config/cucumber.yml 0000664 0000000 0000000 00000000173 14500011231 0016466 0 ustar 00root root 0000000 0000000 default: --format pretty --strict --color
guard: --format pretty --strict --color
travis: --format pretty --strict --color
guard-2.18.1/features/ 0000775 0000000 0000000 00000000000 14500011231 0014506 5 ustar 00root root 0000000 0000000 guard-2.18.1/features/api.feature 0000664 0000000 0000000 00000001056 14500011231 0016636 0 ustar 00root root 0000000 0000000 Feature: using Guard API
In order to reuse existing Guard functionality
As a user
I want to call Guard API without Guard
Background: Guard is installed through bundler
Given my Gemfile includes "gem 'rake'"
And Guard is bundled using source
@spawn
Scenario: Call notifier
Given my Rakefile contains:
"""
require "bundler/setup"
require "guard/notifier"
task :default do
Guard::Notifier.notify "foo", title: "bar"
end
"""
Given I run `bundle exec rake`
Then the output should match /bar\nfoo/
guard-2.18.1/features/callbacks.feature 0000664 0000000 0000000 00000001552 14500011231 0020005 0 ustar 00root root 0000000 0000000 Feature: callbacks
In order to run custom actions before and after tasks
As a user
I want to add callback hooks
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Add a callback hook
Given my Guardfile contains:
"""
require 'guard/plugin'
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) do
watch(/foo/)
callback(:run_on_additions_end) do
$stdout.puts "Callback called!"
$stdout.flush
end
end
"""
Given I start `bundle exec guard -n f`
And I create a file "foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Callback called!/
guard-2.18.1/features/handle_failing_task.feature 0000664 0000000 0000000 00000002026 14500011231 0022031 0 ustar 00root root 0000000 0000000 Feature: gracefully handling plugin failures
In order to prevent restarting Guard after plugin failures
As a user
I want Guard to gracefully ignore plugin failures
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Continue after a failing task
Given my Guardfile contains:
"""
require 'guard/plugin'
module ::Guard
class EpicFail < Plugin
def run_on_modifications(files)
fail "epic fail!"
end
end
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:epic_fail) { watch('foo') }
guard(:myplugin) { watch('bar') }
"""
Given an empty file named "foo"
When I start `bundle exec guard -n f`
And I append to the file "foo"
And I create a file "bar"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["bar"\]/
guard-2.18.1/features/ignores.feature 0000664 0000000 0000000 00000001535 14500011231 0017535 0 ustar 00root root 0000000 0000000 Feature: ignore files and directories
In order to receive only relevant changes
As a user
I want to specify which files and directories to ignore globally
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Ignore events matching ignore regexp
Given my Guardfile contains:
"""
require 'guard/plugin'
ignore /bar/
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) { watch(/ba/) }
"""
Given I start `bundle exec guard -n f`
And I create a file "baz"
And I create a file "bar"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["baz"\]/
guard-2.18.1/features/init.feature 0000664 0000000 0000000 00000003363 14500011231 0017033 0 ustar 00root root 0000000 0000000 Feature: Guard "init" command
In order to quickly start a new project with Guard
As a user
I want Guard to create a Guardfile template for me
@in-process
Scenario: Create an empty Guardfile
When I run `guard init -b`
Then the output should match /Writing new Guardfile to .*Guardfile$/
And the file "Guardfile" should contain "# A sample Guardfile"
@in-process
Scenario: Create a Guardfile using a plugin's template
When I run `guard init rspec`
Then the output should match /Writing new Guardfile to .*Guardfile$/
And the file "Guardfile" should match /^guard :rspec, cmd: ['"]bundle exec rspec["'] do$/
@in-process
Scenario: Add plugin to when empty Guardfile exists
Given my Guardfile contains:
"""
"""
When I run `guard init rspec`
Then the output should match /rspec guard added to Guardfile, feel free to edit it$/
And the file "Guardfile" should match /^guard :rspec, cmd: ['"]bundle exec rspec["'] do$/
@in-process
Scenario: Add plugin when Guardfile contains only options
Given my Guardfile contains:
"""
notification :off
"""
When I run `guard init rspec`
Then the output should match /rspec guard added to Guardfile, feel free to edit it$/
And the file "Guardfile" should match /^guard :rspec, cmd: ['"]bundle exec rspec["'] do$/
@in-process
Scenario: Avoid adding plugin multiple times
Given my Guardfile contains:
"""
"""
When I run `guard init rspec`
And I run `guard init rspec`
Then the output should match /rspec guard added to Guardfile, feel free to edit it/
And the output should match /.*Guardfile already includes rspec guard/
And the file "Guardfile" should match /^guard :rspec, cmd: ['"]bundle exec rspec["'] do$/
guard-2.18.1/features/interrupt.feature 0000664 0000000 0000000 00000001377 14500011231 0020127 0 ustar 00root root 0000000 0000000 Feature: handle while editing CTRL-C
In order to cancel a command in Pry
As a user
I want CTRL-C to clear the Pry prompt
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Continue after a failing task
Given my Guardfile contains:
"""
require 'guard/plugin'
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) { watch('bar') }
"""
Given an empty file named "foo"
When I start `bundle exec guard -n f`
And I press Ctrl-C
And I type in "1+2"
And I stop guard
Then the output should match /=> 3/
guard-2.18.1/features/logging.feature 0000664 0000000 0000000 00000002722 14500011231 0017514 0 ustar 00root root 0000000 0000000 Feature: setting logger options
In order to customize logging output
As a user
I want to specify the logger options
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Customize logger template
Given my Guardfile contains:
"""
require 'guard/plugin'
logger(template: '[Custom - :severity - :time - :progname] :message')
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard :myplugin do
watch('foo')
end
"""
Given I start `bundle exec guard -n f`
And I create a file "foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /\[Custom - INFO - \d\d:\d\d:\d\d - Guard]/
@spawn
Scenario: Customize logger level
Given my Guardfile contains:
"""
require 'guard/plugin'
logger(level: :warn)
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard :myplugin do
watch('foo')
end
"""
Given I start `bundle exec guard -n f`
And I create a file "foo"
And I wait for Guard to become idle
And I stop guard
Then the output should not contain "INFO"
guard-2.18.1/features/notifiers.feature 0000664 0000000 0000000 00000001134 14500011231 0020064 0 ustar 00root root 0000000 0000000 Feature: Notifiers
In order to know what notifiers are available
As a developer using Guard
I want to see a table of notifiers and their options
@in-process
Scenario: Show notifiers and their configuration
Given a file named "Guardfile" with:
# NOTE: don't actually add notifiers, because Guard detects notifier client
# mode - where Notifier.add() will fail
"""
guard :cucumber do
end
"""
When I run `guard notifiers`
Then the output should match /^\s+\| Name \s*\| Available \s*\|/
Then the output should match /^\s+\| terminal_title \s* \| .\s* \|/
guard-2.18.1/features/show.feature 0000664 0000000 0000000 00000001617 14500011231 0017050 0 ustar 00root root 0000000 0000000 Feature: Show
In order to know the defined groups and plugins
As a developer using Guard
I want to see a table of groups and plugins
@in-process
Scenario: Show error when no Guardfile
When I run `guard show`
Then the output should match /No Guardfile found, please create one with `guard init`\./
And the exit status should not be 0
@in-process
Scenario: Show error when Guardfile has no plugins
Given an empty file named "Guardfile"
When I run `guard show`
Then the output should match /No Guard plugins found in Guardfile, please add at least one\.$/
# TODO: this step fails
# And the exit status should not be 0
@in-process
Scenario: Show plugins and their configuration
Given a file named "Guardfile" with:
"""
guard :cucumber do
end
"""
When I run `guard show`
Then the output should match /^\s+\| Default \| Cucumber\s+\|/
guard-2.18.1/features/start.feature 0000664 0000000 0000000 00000001366 14500011231 0017226 0 ustar 00root root 0000000 0000000 Feature: Guard "start" command
In order to automate my workflow
As a user
I want Guard to respond to file changes
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Run a task
Given my Guardfile contains:
"""
require 'guard/plugin'
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard :myplugin do
watch('foo')
end
"""
When I start `bundle exec guard -n f`
And I create a file "foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["foo"\]/
guard-2.18.1/features/step_definitions/ 0000775 0000000 0000000 00000000000 14500011231 0020054 5 ustar 00root root 0000000 0000000 guard-2.18.1/features/step_definitions/guard_steps.rb 0000664 0000000 0000000 00000003252 14500011231 0022723 0 ustar 00root root 0000000 0000000 Given(/^my Guardfile contains:$/) do |contents|
write_file("Guardfile", contents)
end
Given(/^my Rakefile contains:$/) do |contents|
write_file("Rakefile", contents)
end
Given(/^my Gemfile includes "([^"]*)"$/) do |gem|
(@gems ||= []) << gem
end
Given(/^Guard is bundled using source$/) do
gems = @gems || []
gems << "gem 'guard', path: File.expand_path(File.join(Dir.pwd, '..', '..'))"
write_file("Gemfile", "#{gems.join("\n")}\n")
run_command_and_stop("bundle install --quiet", fail_on_error: true)
end
When(/^I start `([^`]*)`$/) do |cmd|
skip_this_scenario if defined?(JRUBY_VERSION)
@interactive = run_command(cmd)
step "I wait for Guard to become idle"
end
When(/^I create a file "([^"]*)"$/) do |path|
write_file(path, "")
# give guard time to respond to change
type "sleep 1"
end
When(/^I append to the file "([^"]*)"$/) do |path|
append_to_file(path, "modified")
# give guard time to respond to change
type "sleep 1"
end
When(/^I stop guard$/) do
close_input
end
When(/^I wait for Guard to become idle$/) do
expected = "guard(main)>"
begin
Timeout.timeout(aruba.config.exit_timeout) do
loop do
break if last_command_started.stdout.include?(expected)
sleep 0.1
end
end
rescue Timeout::Error
STDERR.puts all_stdout
STDERR.puts all_stderr
fail
end
end
When(/^I type in "([^"]*)"$/) do |line|
type line
end
When(/^I press Ctrl-C$/) do
skip_this_scenario if Nenv.ci?
# Probably needs to be fixed on Windows
obj = @interactive.instance_variable_get(:@delegate_sd_obj)
pid = obj.instance_variable_get(:@process).pid
Process.kill("SIGINT", pid)
step "I wait for Guard to become idle"
end
guard-2.18.1/features/support/ 0000775 0000000 0000000 00000000000 14500011231 0016222 5 ustar 00root root 0000000 0000000 guard-2.18.1/features/support/env.rb 0000664 0000000 0000000 00000001513 14500011231 0017337 0 ustar 00root root 0000000 0000000 require "aruba"
require "aruba/cucumber"
require "aruba/in_process"
require "aruba/spawn_process"
require "guard/aruba_adapter"
Before("@spawn") do
aruba.config.command_launcher = :spawn
gemfile_path = expand_path("Gemfile")
set_environment_variable "BUNDLE_GEMFILE", File.expand_path(gemfile_path)
set_environment_variable "RUBY_OPT", "-W0"
set_environment_variable(
"GUARD_NOTIFIERS",
"---\n"\
"- :name: :file\n"\
" :options:\n"\
" :path: '/dev/stdout'\n"
)
end
Before("@in-process") do
aruba.config.command_launcher = :in_process
aruba.config.main_class = Guard::ArubaAdapter
end
Before do
set_environment_variable "INSIDE_ARUBA_TEST", "1"
home = expand_path("home")
set_environment_variable "HOME", home
FileUtils.mkdir(home)
@aruba_timeout_seconds = Cucumber::JRUBY ? 45 : 15
end
guard-2.18.1/features/version.feature 0000664 0000000 0000000 00000000414 14500011231 0017547 0 ustar 00root root 0000000 0000000 Feature: Guard "version" command
In order to know if the Guard is up to date
As a user
I want to get the Guard version
@in-process
Scenario: Show Guard's version
When I run `guard version`
Then the output should match /^Guard version \d+.\d+.\d+$/
guard-2.18.1/features/watched_directories.feature 0000664 0000000 0000000 00000004352 14500011231 0022102 0 ustar 00root root 0000000 0000000 Feature: watch directories
In order to receive only relevant changes
As a user
I want to specify which directories Guard should monitor
Background: Guard is installed through bundler
Given Guard is bundled using source
@spawn
Scenario: Watch current directory by default
Given my Guardfile contains:
"""
require 'guard/plugin'
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) { watch(/foo/) }
"""
Given I start `bundle exec guard -n f`
And I create a file "foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["foo"\]/
@spawn
Scenario: Watch only given directory
Given my Guardfile contains:
"""
$stdout.sync = true
require 'guard/plugin'
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) { watch(/.*/) }
"""
Given a directory named "not_watched"
And a directory named "watched"
And I start `bundle exec guard -n f -w watched`
And I create a file "watched/foo"
And I create a file "not_watch/foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["watched.foo"\]/
@spawn
Scenario: Watch directories provided in Guardfile
Given my Guardfile contains:
"""
$stdout.sync = true
$stderr.sync = true
require 'guard/plugin'
directories ['watched']
module ::Guard
class Myplugin < Plugin
def run_on_additions(files)
$stdout.puts "Files added: #{files.inspect}"
$stdout.flush
end
end
end
guard(:myplugin) { watch(/.*/) }
"""
Given a directory named "not_watched"
And a directory named "watched"
And I start `bundle exec guard -n f`
And I create a file "watched/foo"
And I create a file "not_watch/foo"
And I wait for Guard to become idle
And I stop guard
Then the output should match /Files added: \["watched.foo"\]/
guard-2.18.1/guard.gemspec 0000664 0000000 0000000 00000002527 14500011231 0015345 0 ustar 00root root 0000000 0000000 # encoding: utf-8
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
require "guard/version"
Gem::Specification.new do |s|
s.name = "guard"
s.version = Guard::VERSION
s.platform = Gem::Platform::RUBY
s.license = "MIT"
s.authors = ["Thibaud Guillaume-Gentil"]
s.email = ["thibaud@thibaud.gg"]
s.homepage = "https://guard.github.io/guard/"
s.summary = "Guard keeps an eye on your file modifications"
s.description = "Guard is a command line tool to easily handle events"\
" on file system modifications."
s.required_ruby_version = ">= 1.9.3"
s.add_runtime_dependency "thor", ">= 0.18.1"
s.add_runtime_dependency "listen", ">= 2.7", "< 4.0"
s.add_runtime_dependency "pry", ">= 0.13.0"
s.add_runtime_dependency "lumberjack", ">= 1.0.12", "< 2.0"
s.add_runtime_dependency "formatador", ">= 0.2.4"
s.add_runtime_dependency "nenv", "~> 0.1"
s.add_runtime_dependency "shellany", "~> 0.0"
s.add_runtime_dependency "notiffany", "~> 0.0"
git_files = `git ls-files -z`.split("\x0")
files = git_files.select { |f| %r{^(?:bin|lib)/.*$} =~ f }
files += %w(CHANGELOG.md LICENSE README.md)
files += %w(man/guard.1 man/guard.1.html)
# skip the large images/guard.png
files += %w(images/pending.png images/failed.png images/success.png)
s.files = files
s.executables = %w[guard _guard-core]
s.require_path = "lib"
end
guard-2.18.1/images/ 0000775 0000000 0000000 00000000000 14500011231 0014135 5 ustar 00root root 0000000 0000000 guard-2.18.1/images/failed.png 0000664 0000000 0000000 00000007621 14500011231 0016075 0 ustar 00root root 0000000 0000000 PNG
IHDR 0 0 pHYs gAMA o3 cHRM l ro n A 1t l- IDATxL
M567j[KR4KldHm@pۥmp:C9"Gx::.'3)Z6 W {MwY_[=m Tϡ
P FsaeWhtAg#A1Y@P.oPOp$F8L!F°4fn$E_| ef<