Skip to content

Scope plugins and groups #378

merged 6 commits into from Dec 19, 2012

3 participants


This adds setting an initial plugin scope from the cli (in addition to the already existing group scope), shows the current scope in the interactor and let it change at runtime with the new scope (or o as shortcut).

But let's see it in action instead of this boring description:

$ bundle exec guard help start 
  -g, [--group=Run only the passed groups]                                                                    
  -P, [--plugin=Run only the passed plugins]  

Yeah I know, but -p is already for polling. So now you can pass a plugin to scope the actions to, like

$ bundle exec guard -P ronn
[1] {Ronn} guard(main)>

As you can see, the current scope is visible within the mustaches {ronn}. This means that the change, run_all and reload actions are globally scoped to ronn and no other plugins are triggered:

[1] {Ronn} guard(main)> r
15:54:53 - INFO - Reload ronn
[2] {Ronn} guard(main)> 

but you can overwrite the global scope by providing a local scope:

[2] {Ronn} guard(main)> r rspec
15:55:20 - INFO - Reload rspec
[3] {Ronn} guard(main)>

To change the scope, use the scope command or its shorthand o:

[3] {Ronn} guard(main)> o rspec
[4] {Rspec} guard(main)>

To clear the scope, just call it without parameter:

[4] {Rspec} guard(main)> o
[5] guard(main)> 

The same is true for groups:

$ bundle exec guard -g docs
[1] {Docs} guard(main)> 

That's all. Happy scoping!

Guard member
rymai commented Dec 19, 2012

That's totally awesome @netzpirat, I love you so much!! ❤️

Guard member

Really nice! Thanks!

@netzpirat netzpirat merged commit c4ebdd1 into master Dec 19, 2012

1 check passed

Details default The Travis build passed
@netzpirat netzpirat deleted the scope-plugins-and-groups branch Dec 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.