{"payload":{"header_redesign_enabled":false,"results":[{"body":"Welcome to the circuitbreaker wiki!","filename":"Home.md","format":"markdown","hl_body":"Welcome to the circuitbreaker wiki!","hl_title":"Home","id":"75560c35c76aa2572c997d3e91278e03208576ff","path":"Home.md","public":true,"repo":{"repository":{"id":22474154,"name":"circuitbreaker","owner_id":9919,"owner_login":"github","updated_at":"2014-07-31T19:26:15.879Z","has_issues":false}},"repo_id":22474154,"title":"Home","updated_at":"2016-08-25T17:31:52.000+02:00"},{"body":"Guide for the spdxexp package. Maintainers Guides Release Process","filename":"Home.md","format":"markdown","hl_body":"Guide for the spdxexp package. Maintainers Guides Release Process","hl_title":"Home","id":"41e92d9a92236a4a9656201a55871f9453275812","path":"Home.md","public":true,"repo":{"repository":{"id":528388612,"name":"go-spdx","owner_id":9919,"owner_login":"github","updated_at":"2024-06-06T16:42:51.213Z","has_issues":true}},"repo_id":528388612,"title":"Home","updated_at":"2022-11-18T15:53:58.000-05:00"},{"body":"1. Clean up dependencies (Removes any packages no longer in use.) go mod tidy 2. Generate documentation to be sure it is correct May have to install godoc first: go get golang.org/x/tools/cmd/godoc Generate documentation: godoc -http=:6060 & View generated documentation at: http://localhost:6060/pkg/github.com/github/spdx-expression/spdxexp 3. Draft a new release 1. Choose a tag - > type new tag number starting with a `v` and following [Semantic Versioning](https://semver.org/) principles (e.g. v0.2.0)\n2. Set title (e.g. Release v0.2.0)\n3. Write release notes including sections: ([example](https://github.com/github/spdx-expression/releases/tag/v0.2.0))\n 1. Overview - brief description of the primary change(s)\n 2. Required Actions for Upgrading - list any steps that are required to update to this version\n 3. Details - include a subsection with a description, examples, and other details for each change that impacts usage or functioning\n 4. What's Changed - simple list of major changes and link to diff from previous release to this release 4. Release to go packages When the release is published, pkg.go.dev automatically finds the new version. There is a delay, but it will happen. 5. Update README if changes impact behavior, update README to reflect this update the Go Reference badge to point to the new version NOTE: Until pkg.go.dev picks up the new version, the badge will get a message that it doesn't exist. You may have the option to request the newer version.","filename":"Release-Process.md","format":"markdown","hl_body":"1. Clean up dependencies (Removes any packages no longer in use.) go mod tidy 2. Generate documentation to be sure it is correct May have to install godoc first: go get golang.org/x/tools/cmd/godoc Generate ...","hl_title":"Release Process","id":"14281cfd2ab79fede36c066549f80b05c9ebe38a","path":"Release-Process.md","public":true,"repo":{"repository":{"id":528388612,"name":"go-spdx","owner_id":9919,"owner_login":"github","updated_at":"2024-06-06T16:42:51.213Z","has_issues":true}},"repo_id":528388612,"title":"Release Process","updated_at":"2023-03-21T11:22:04.000-04:00"},{"body":"NOTE: guard-zeus causes issues when typing into the Pry session. See: https://github.com/guard/guard-zeus/issues/18 for a workaround Adding Readline support to Pry If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strangely, then you probably suffer under a Ruby build that uses libedit instead of readline . If you are not using Mac OS X or are using JRuby, then you're fine. Option 1: Build Ruby With GNU Readline Using RVM You can use RVM to build your Ruby with GNU readline support. First install the readline package with RVM: $ rvm pkg install readline --verify-downloads 1 Then configure RVM to use the readline package by adding ruby_configure_flags=--with-readline-dir= \" $rvm_path /usr \" to ~/.rvm/user/db . Finally you need to reinstall your Ruby of choice: $ rvm reinstall 1.9.3 Option 2: Build Ruby With GNU Readline Using RVM and Homebrew You can also install the latest Readline with Homebrew . First install Readline: $ brew install readline\n$ brew link readline Then configure RVM to use the Homebrew readline by adding ruby_configure_flags=--with-readline-dir=/usr/local/opt/readline to ~/.rvm/user/db . Finally you need to reinstall your Ruby of choice: $ rvm reinstall 1.9.3 Option 3: Build Ruby With GNU Readline Using rbenv, ruby_build and Homebrew As a rbenv user, you can install readline and ruby_build with Homebrew: $ brew install readline ruby-build now set the configure options when compile Ruby: $ RUBY_CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 1.9.3-p286 Option 4: Using a pure Ruby readline implementation The easiest way to get a working readline implementation is to install rb-readline , a pure Ruby readline implementation. You can install it by simply adding group :development do gem 'rb-readline' end to your Gemfile and install it with bundle exec .","filename":"Add-Readline-support-to-Ruby-on-Mac-OS-X.md","format":"markdown","hl_body":"NOTE: guard-zeus causes issues when typing into the Pry session. See: https://github.com/guard/guard-zeus/issues/18 for a workaround Adding Readline support to Pry If you are on Mac OS X and have problems ...","hl_title":"Add Readline support to Ruby on Mac OS X","id":"43b1747cb16605418411eb399f1861c93e322ac9","path":"Add-Readline-support-to-Ruby-on-Mac-OS-X.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Add Readline support to Ruby on Mac OS X","updated_at":"2015-01-09T06:15:56.000+01:00"},{"body":"This page collects information about the fired inotify events that different Linux editors fires on file modification. The events are collected using inotifywait . Steps to add an event analysis of your editor: Open the file Launch inotifywait -m . in the directory containing the file Change the file content Save the file Quit inotifywait IMPORTANT NOTE : Remember to watch the directory containing the file, not the file itself! Results RubyMine (v3.2.4 & & v4.0EAP, Lucid 64) Manual and auto-save events are currently indistinguishable\nTo disable RubyMine's auto-save/synchronization feature: File > Settings > General total attrib delete_self filename\n3 1 1 coffee/script.coffee Sublime Text total modify close_write open filename\n5 3 1 1 coffee/script.coffee Sublime Text 3 on Linux Given a file coffee/script.coffee and watching the coffee dir: % inotifywait -m coffee\nSetting up watches.\nWatches established.\n./ CREATE .sublc0f.tmp\n./ OPEN .sublc0f.tmp\n./ ATTRIB .sublc0f.tmp\n./ MODIFY .sublc0f.tmp\n./ CLOSE_WRITE,CLOSE .sublc0f.tmp\n./ ATTRIB .sublc0f.tmp\n./ MOVED_FROM .sublc0f.tmp\n./ MOVED_TO script.coffee Note how there's only 1 event actually on the directory: MOVED_TO. (This is because Sublime calls rename() without deleting the file, which makes Guard think it's a new file, which calls the run_on_additions plugin method - a method many guard plugins don't implement). Kate Details: Kate creates a backup file, e.g. foo.rb - > foo.rb~ (suffix is configurable) Kate uses QTemporaryFile with a template \"XXXXXX.new\", which means e.g. foo.rb - > foo.rbo53241.new (see: qtemporaryfile.cpp) Kate uses \"overwrite\" technique to allow saving file in read-only directories: foo.rbo53241.new - > foo.rb (no delete happens) E.g.: [:delete]: users_controller_spec.rb~\n[:moved_to, :move]: users_controller_spec.rb~\n[:attrib]: users_controller_spec.rb~\n[:create]: users_controller_spec.rbo22583.new\n[:attrib]: users_controller_spec.rbo22583.new\n[:close_write, :close]: users_controller_spec.rbo22583.new\n[:close_write, :close]: users_controller_spec.rbo22583.new\n[:moved_from, :move]: users_controller_spec.rbo22583.new\n[:moved_to, :move]: users_controller_spec.rb Vim total attrib move_self delete_self filename\n4 1 1 1 coffee/script.coffee Details: The events Vim generates during saving actually depends on options, e.g. backup/backupdir/patchmode/backupcopy/writebackup/backupskip Gedit total access attrib close_write close_nowrite open delete_self filename\n8 1 1 1 1 2 1 coffee/script.coffee Nano total modify close_write open filename\n5 3 1 1 coffee/script.coffee Joe total access modify attrib close_write close_nowrite open filename\n10 1 4 1 1 1 2 coffee/script.coffee JEdit total move_self filename\n1 1 coffee/script.coffee SciTE total modify close_write open filename\n5 3 1 1 coffee/script.coffee Bluefish total attrib close_write open filename\n4 2 1 1 coffee/script.coffee echo 'foo' > coffee/test.txt total modify close_write open filename\n4 2 1 1 coffee/test.txt Redcar 0.12 total modify close_write open filename\n4 2 1 1 coffee/script.coffee emacs 24 total access modify close_write close_nowrite open filename\n9 1 2 1 2 3 my/fine/file sed Sed uses the \"overwrite with move\" trick.\n\nfrom running: `sed -e 's/a/b/' -i index.html`\n\n./ OPEN index.html\n./ CREATE sedBF20nx\n./ OPEN sedBF20nx\n./ MODIFY sedBF20nx\n./ MODIFY sedBF20nx\n./ MODIFY sedBF20nx\n./ MODIFY sedBF20nx\n./ ATTRIB sedBF20nx\n./ ATTRIB sedBF20nx\n./ CLOSE_NOWRITE,CLOSE index.html\n./ CLOSE_WRITE,CLOSE sedBF20nx\n./ MOVED_FROM sedBF20nx\n./ MOVED_TO index.html","filename":"Analysis-of-inotify-events-for-different-editors.md","format":"markdown","hl_body":"This page collects information about the fired inotify events that different Linux editors fires on file modification. The events are collected using inotifywait . Steps to add an event analysis of your ...","hl_title":"Analysis of inotify events for different editors","id":"93ecd2670d3169ada3726036843d1ac77bf60e18","path":"Analysis-of-inotify-events-for-different-editors.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Analysis of inotify events for different editors","updated_at":"2014-12-19T14:56:32.000-08:00"},{"body":"You can use additional command line options to enhance Guard. These can be appended to the command line: $ bundle exec guard < option > UI options -c / --clear option - to clear the screen between tasks -n / --notify option - to enable/disable popup notification -T option - to show Guardfile config -i / --no-interactions option - to enable/disable Pry console -d / --debug option - to enable debug mode -B / --no-bundler-warning option - to prevent bundler warning from being shown Config options -g / --group option - to activate only specified groups -P / --plugin option - to activate only specified plugins -w / --watchdir option - to watch only given directories -G / --guardfile option - to use a different Guardfile Listen Options -l / --latency option - to how long until Listen detects changes -p / --force-polling option - to force Listen to use polling mode -y / --wait-for-delay option - how long Listen can wait until disk activity dies down -o / --listen-on option - to listen for events send over TCP -c / --clear option The shell can be cleared after each change: $ bundle exec guard --clear\n$ bundle exec guard -c # shortcut You may prefer to enable clearing in all projects by addin the clearing statement (described below) in you ~/.guard.rb instead: clearing :on -n / --notify option System notifications can be disabled: $ bundle exec guard --notify false $ bundle exec guard -n f # shortcut Notifications can also be disabled globally by setting a GUARD_NOTIFY environment variable to false . -g / --group option Scope Guard to certain plugin groups on start: $ bundle exec guard --group group_name another_group_name\n$ bundle exec guard -g group_name another_group_name # shortcut See the Guardfile DSL below for creating groups. -P / --plugin option Scope Guard to certain plugins on start: $ bundle exec guard --plugin plugin_name another_plugin_name\n$ bundle exec guard -P plugin_name another_plugin_name # shortcut -d / --debug option Guard can display debug information (useful for plugin\ndevelopers) with: $ bundle exec guard --debug\n$ bundle exec guard -d # shortcut -w / --watchdir option Guard by default watches the current directory recursively, but you can tell Guard to watch only the directories you want: $ bundle exec guard --watchdir source/files # watch a subdirectory of your project $ bundle exec guard -w source/files # shortcut $ bundle exec guard -w sources/foo assets/foo ./config # multiple directories $ bundle exec guard -w /fancy/project # path outside project - watch out! (see below) NOTE: this option is only meant for ignoring subdirectories in the CURRENT\ndirectory - by selecting which ones to actually track. If your watched directories are outside the current one, or if --watchdir isn't working\nas you expect, be sure to read: Correctly using --watchdir You may find it more convenient to use the directories statement (described\nbelow) in your Guardfile. -G / --guardfile option Guard can use a Guardfile not located in the current directory: $ bundle exec guard --guardfile ~ /.your_global_guardfile\n$ bundle exec guard -G ~ /.your_global_guardfile # shortcut TIP: set BUNDLER_GEMFILE environment variable to point to your Gemfile if it isn't in the current directory or the current Gemfile doesn't include all your favorite plugins -i / --no-interactions option Turn off completely any Guard terminal interactions with: $ bundle exec guard start -i\n$ bundle exec guard start --no-interactions -B / --no-bundler-warning option Skip Bundler warning when a Gemfile exists in the project directory but Guard is not run with Bundler. $ bundle exec guard start -B\n$ bundle exec guard start --no-bundler-warning -l / --latency option Overwrite Listen's default latency, useful when your hard-drive / system is slow. $ bundle exec guard start -l 1.5\n$ bundle exec guard start --latency 1.5 NOTE: this option is OS specific: while higher values may reduce CPU usage\n(and lower values may increase responsiveness) when in polling mode , it has no\neffect for optimized backends (except on Mac OS). If guard is not behaving as\nyou want, you'll likely instead want to tweak the --wait-for-delay option\nbelow or use the --watchdirs option. -p / --force-polling option Force Listen polling listener usage. $ bundle exec guard start -p\n$ bundle exec guard start --force-polling -y / --wait-for-delay option Overwrite Listen's default wait_for_delay, useful for kate-like editors through\nssh access or when guard is annoyingly running tasks multiple times. $ bundle exec guard start -y 1\n$ bundle exec guard start --wait-for-delay 1 -T option You can show the structure of the groups and their plugins with the show task: $ bundle exec guard show\n+---------+--------+-----------------+----------------------------+ | Group | Plugin | Option | Value | +---------+--------+-----------------+----------------------------+ | Specs | Rspec | all_after_pass | true | | | | all_on_start | true | | | | cli | \" --fail-fast --format doc \" | | | | focus_on_failed | false | | | | keep_failed | true | | | | run_all | {} | | | | spec_paths | [ \" spec \" ] | +---------+--------+-----------------+----------------------------+ | Docs | Ronn | | | +---------+--------+-----------------+----------------------------+ This shows the internal structure of the evaluated Guardfile or .Guardfile , with the .guard.rb file. You can\nread more about these files in the shared configuration section . -b / --bare option You can generate an empty Guardfile by running the init task with the bare\noption: $ bundle exec guard init --bare\n$ bundle exec guard init -b # shortcut Running Guard in a VM -o / --listen-on option Use Listen's network functionality to receive file change events from the network. This is most useful for virtual machines (e.g. Vagrant) which have problems firing native filesystem events on the guest OS. Suggested use: On the host OS, you need to listen to filesystem events and forward them to your VM using the listen script: $ listen -f 127.0.0.1:4000 Remember to configure your VM to forward the appropriate ports, e.g. in Vagrantfile: config . vm . network :forwarded_port , guest : 4000 , host : 4000 Then, on your guest OS, listen to the network events but ensure you specify the host path $ bundle exec guard -o ' 10.0.2.2:4000 ' -w ' /projects/myproject '","filename":"Command-line-options-for-Guard.md","format":"markdown","hl_body":"You can use additional command line options to enhance Guard. These can be appended to the command line: $ bundle exec guard < option > UI options -c / --clear option - to clear the screen between ...","hl_title":"Command line options for Guard","id":"b34f024c036b148e721d943e17ac6142f599e5cd","path":"Command-line-options-for-Guard.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Command line options for Guard","updated_at":"2015-06-26T11:06:43.000+02:00"},{"body":"Files used by Guard Project-specific Guard DSL files: Guardfile (in current directory) - can contain DSL statements, evaluated by Guard during startup .Guardfile (in current directory) - if it exists, it is used instead of the Guardfile Global Guard DSL files: ~/.guard.rb (in home directory) - can contain DSL statements. If it exists, it is always evaluated by Guard (before evaluating the project-specific DSL). Pry-only config ~/.guardrc (in home directory) - if it exists, it is evaluated by the Pry interator (and should not contain DSL statements)","filename":"Configuration-files.md","format":"markdown","hl_body":"Files used by Guard Project-specific Guard DSL files: Guardfile (in current directory) - can contain DSL statements, evaluated by Guard during startup .Guardfile (in current directory) - if it exists, ...","hl_title":"Configuration files","id":"eea994a7da3db18ea5cfb2a59e03651c745850d6","path":"Configuration-files.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Configuration files","updated_at":"2015-01-05T23:54:28.000+01:00"},{"body":"From version > = 0.7.0 Posix Signal handlers are no more used to interact with Guard. The Guard keyboard shortcuts are in fact signals that are being trapped. Signals are specified in POSIX.1 standard and not all operating systems are full POSIX compliant (like embedded systems and windows). You can send signals to Guard with the kill command on Unix like operating systems. Guard uses the following signals: SIGHUP = > Run all SIGINT = > Stop SIGTSTP = > Reload You can set the options for a terminal device interface with the stty command. This allows you to list the current control characters for signals: $ stty -a\ncchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = < undef > ;\neol2 = < undef > ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;\nmin = 1; quit = ^\\; reprint = ^R; start = ^Q; status = ^T;\nstop = ^S; susp = ^Z; time = 0; werase = ^W; Now you can change the control character for SIGQUIT : $ stty quit \"^R\" This maps Guards' Run all to Ctrl-R . If you use Guard on Windows, you should install Cygwin and make sure you have the coreutils package installed to have the appropriate commands available in your shell.","filename":"Configure-keyboard-shortcuts.md","format":"markdown","hl_body":"From version > = 0.7.0 Posix Signal handlers are no more used to interact with Guard. The Guard keyboard shortcuts are in fact signals that are being trapped. Signals are specified in POSIX.1 standard ...","hl_title":"Configure keyboard shortcuts","id":"454fc8aea2a2d11e90a2e1031204d354cc36e8dd","path":"Configure-keyboard-shortcuts.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Configure keyboard shortcuts","updated_at":"2011-09-04T05:31:12.000-07:00"},{"body":"Intro The --watchdir option (and the directories statement in the Guardfile ) allow watching directories other than just the current one. Guard handles paths relative to the current directory. So, if you're watching foo/bar , your watcher patterns will be matched against files like foo/bar/baz.txt . This means you can watch any directories relative to the current one - without changing the patterns in your Guardfile . But if you watch paths outside your project, this behavior changes (see below about absolute paths). Examples $ bundle exec guard --watchdir source/files # watch a subdirectory of your project $ bundle exec guard -w source/files # shortcut $ bundle exec guard -w sources/foo assets/foo ./config # multiple directories $ bundle exec guard -w . /fancy/project # path outside project - watch out! (see info below) A good example use case in a Rails project may be: # Thanks to this, we aren't tracking changes in: db, log, tmp, doc and vendor $ bin/guard -w app config features lib public spec Watching paths outside your project dir E.g. if your project is in /projects/foo and you are watching /foo/bar , then your Guardfile rules would have to use absolute paths. This is inconvenient, because it would force you to use absolute paths in your Guardfile. So the solution is to run guard from inside the directory containing the paths you want to watch. But since the Guardfile is in the project directory - you want to use the '-G option` to tell guard where the Guardfile is. Example (if Guardfile is not where you're tracking files): If your Guardfile is in /projects/foo/ and the files you track are in /data/bar/ , you might be tempted to run: $ cd /projects/foo\n$ bin/guard -w /data/bar\n$ echo \"changes\" > > /data/bar/baz This won't work unless your Guardfile has watch statements for paths like ../../data/bar/baz (so regexps would have to additionally handle the\nunexpected ../.. in paths). Note: On Windows, if the paths contain different drives, you'll get full paths\ncontaining the drive. Since Guardfiles are more robust if tracked files are within the current\ndirectory, you should instead consider \"reversing things\": go to the directory where the watched files are use BUNDLE_GEMFILE to point back to where your Gemfile is use the -G options to point to where your Guardfile is $ cd /data/bar\n$ BUNDLE_GEMFILE=/projects/foo/Gemfile bundle exec guard -G /projects/foo/Guardfile\n$ echo \"changes\" > > ./baz Example rule in Guardfile watch ( /^baz$/ ) { ( ... ) } This, way, the Guardfile becomes simple, since it will only get the relative\npath 'baz' (because it's relative to current directory).","filename":"Correctly-using-the---watchdir-option.md","format":"markdown","hl_body":"Intro The --watchdir option (and the directories statement in the Guardfile ) allow watching directories other than just the current one. Guard handles paths relative to the current directory. So, if you're ...","hl_title":"Correctly using the watchdir option","id":"83dee6ced7c9e87e3bf7c4d7157a2acf24525d4d","path":"Correctly-using-the---watchdir-option.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Correctly using the watchdir option","updated_at":"2015-06-16T15:05:01.000+01:00"},{"body":"Creating a new Guard is very easy. For example, to create a Guard named yoyo just create a new gem by running bundle gem guard-yoyo . NOTE: Please make your Guard start with guard- , so that it can easily be found on RubyGems. $ bundle gem guard-yoyo\n$ cd guard-yoyo Now extend the project structure to have an initial Guard: .travis.yml # bonus point! CHANGELOG.md # bonus point! Gemfile\nguard-yoyo.gemspec\nGuardfile\nlib/\n guard/\n yoyo/\n templates/\n Guardfile # needed for `guard init < guard-name > ` version.rb\n yoyo.rb\ntest/ # or spec/ README.md In your gemspec, add a runtime dependency on the guard-compat plugin: In guard-yoyo.gemspec: spec.add_dependency 'guard-compat', '~ > 1.1' Your Guard main class Guard::Yoyo in lib/guard/yoyo.rb must inherit from Guard::Plugin All files of Guard::Yoyo class must inherit from Guard::Plugin , including lib/guard/yoyo/version.rb Here is an example scaffold for lib/guard/yoyo.rb : require 'guard/compat/plugin' module Guard class Yoyo < Plugin # Initializes a Guard plugin. # Don't do any work here, especially as Guard plugins get initialized even if they are not in an active group! # # @param [Hash] options the custom Guard plugin options # @option options [Array < Guard::Watcher > ] watchers the Guard plugin file watchers # @option options [Symbol] group the group this Guard plugin belongs to # @option options [Boolean] any_return allow any object to be returned from a watcher # def initialize ( options = { } ) super end # Called once when Guard starts. Please override initialize method to init stuff. # # @raise [:task_has_failed] when start has failed # @return [Object] the task result # def start end # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits). # # @raise [:task_has_failed] when stop has failed # @return [Object] the task result # def stop end # Called when `reload|r|z + enter` is pressed. # This method should be mainly used for \"reload\" (really!) actions like reloading passenger/spork/bundler/... # # @raise [:task_has_failed] when reload has failed # @return [Object] the task result # def reload end # Called when just `enter` is pressed # This method should be principally used for long action like running all specs/tests/... # # @raise [:task_has_failed] when run_all has failed # @return [Object] the task result # def run_all end # Called on file(s) additions that the Guard plugin watches. # # @param [Array < String > ] paths the changes files or paths # @raise [:task_has_failed] when run_on_additions has failed # @return [Object] the task result # def run_on_additions ( paths ) end # Called on file(s) modifications that the Guard plugin watches. # # @param [Array < String > ] paths the changes files or paths # @raise [:task_has_failed] when run_on_modifications has failed # @return [Object] the task result # def run_on_modifications ( paths ) end # Called on file(s) removals that the Guard plugin watches. # # @param [Array < String > ] paths the changes files or paths # @raise [:task_has_failed] when run_on_removals has failed # @return [Object] the task result # def run_on_removals ( paths ) end end end Please take a look at the source code of some of the existing Guards for more concrete example and inspiration. Inline Guard Alternatively, a new Guard can be added inline to a Guardfile with this basic structure: require 'guard/compat/plugin' # the double-colons below are *required* for inline Guards!!! module :: Guard class MyInlineGuard < Plugin def initialize ( options = { } ) opts = options . dup @my_option = opts . delete ( :my_special_option ) super ( opts ) # important to call + avoid passing options Guard doesn't understand end def run_all do_something_special if @my_option end def run_on_modifications ( paths ) end end end @avdi has a very cool inline Guard example in his blog post A Guardfile for Redis .","filename":"Create-a-guard.md","format":"markdown","hl_body":"Creating a new Guard is very easy. For example, to create a Guard named yoyo just create a new gem by running bundle gem guard-yoyo . NOTE: Please make your Guard start with guard- , so that it can easily ...","hl_title":"Create a guard","id":"a37e48a48570b2ef0876465a8dbd04bf49ae8d9a","path":"Create-a-guard.md","public":true,"repo":{"repository":{"id":47153434,"name":"guard","owner_id":9919,"owner_login":"github","updated_at":"2015-12-01T00:12:41.306Z","has_issues":false}},"repo_id":47153434,"title":"Create a guard","updated_at":"2015-09-30T15:06:12.000+08:00"}],"type":"wikis","page":1,"page_count":33,"elapsed_millis":160,"errors":[],"result_count":326,"facets":[],"protected_org_logins":[],"topics":null,"query_id":"","logged_in":false,"sign_up_path":"/signup?source=code_search_results","sign_in_path":"/login?return_to=https%3A%2F%2Fgithub.com%2Fsearch%3Fq%3Dorg%253Agithub%26type%3DWikis%26utf8%3D%25E2%259C%2593","metadata":null},"title":"Wiki search results"}