Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Guards in Guardfile #91

Merged
merged 6 commits into from Jun 22, 2011
Merged

Conversation

johnbintz
Copy link
Member

This addition adds a new CLI method, show (aliased to -T to work like Rake/Capistrano), which concisely lists what's in the Guardfile and in what group:

(global):
  rspec: version => 2
Group exceptional:
  breaking
Group rails:
  rails: port => 6060, timeout => 20, daemon => true
Group doc:
  rocco: dir => doc-rocco
  shell
  livereload

It does it by creating a new DSL introspection class based on Guard::Dsl which prepares a subset of Guardfile structure for display. Individual watches are not shown, since showing those would be a little too much like actually opening the Guardfile.

Written 'cause I was getting lazy about cracking open Guardfiles on all my projects to see what projects had what groups available for running. :) Hopefully should also help new people on Guard-using projects get up to speed with Guard usage faster.

@thibaudgg
Copy link
Member

Awesome, thanks. Can you just add some info about this great feature in the README, inside man pages give more bonus points ;-)

@@ -127,6 +127,9 @@ describe Guard::Dsl do
lambda { subject.evaluate_guardfile(:guardfile_contents => invalid_guardfile_string ) }.should raise_error
end

it "should generate a displayable structure from the Guardfile data" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice empty spec :)

can you complete or remove it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, leftover from trying to figure out the best place for that. Removed.

@johnbintz
Copy link
Member Author

@thibaudgg, what tool do I use to generate the actual man page so I know I'm doing it right?

@rymai
Copy link
Member

rymai commented Jun 21, 2011

I used ronn like this ronn man/guard.md > man/guard.1 && man man/guard.1 but I'll probably write Guard::Ronn for future ease of generation! :)

BTW, I've mostly followed the instructions here: http://shairosenfeld.com/blog/index.php/2011/04/ruby-gems-and-man-pages and here: http://rtomayko.github.com/ronn/ronn-format.7

@johnbintz
Copy link
Member Author

OK I think I build the manpage right. I cleaned it up a bit more, and added a few of the other commands.

@rymai
Copy link
Member

rymai commented Jun 21, 2011

Awesome! Thanks for completing the manpage!

rymai pushed a commit that referenced this pull request Jun 22, 2011
@rymai rymai merged commit d3f7d8d into guard:master Jun 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants