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

Initialize all guards at once #227

Closed
rupert-madden-abbott opened this issue Jan 14, 2012 · 5 comments
Closed

Initialize all guards at once #227

rupert-madden-abbott opened this issue Jan 14, 2012 · 5 comments

Comments

@rupert-madden-abbott
Copy link

When starting a new project, I'll often have several guards in my Gemfile and it sucks having to run guard init for each one.

It would be useful if I could instead initialize them all at once.

I suggest that if guard init is not passed any parameters then:

  • If no guard gems are present in Gemfile, generate an empty Guardfile
  • If guard gems are present, initialize each one
@thibaudgg
Copy link
Member

Hi, yes it sounds like a good idea. Can you submit a pull request for that, it would be great! Thanks.

@rupert-madden-abbott
Copy link
Author

Heya I spent a few hours on this but my coding is not up to scratch. Essentially, Guard.initialize_template will need to use Guard::DslDescriber.evaluate_guardfile in order to get a list of already initialised gems and Guard.guard_gem_names to get a list of already installed gems but I'm not sure how to go about manipulating the output of these methods in the specs so can't produce anything that will pass. Sorry my testing skills are really poor!

@thibaudgg
Copy link
Member

I think the only thing to accomplish here is too add all guards present in the Gemfile to the Guardfile if guard init is run without any parameters (creating an Guardfile when not present is already handled). If some guards (or all) are already present in the Guardfile they will just be added again; It's already the case when you run guard init xxx and I think it's a fine behavior.

@thibaudgg
Copy link
Member

@rupert654 any news?

Maher4Ever added a commit to Maher4Ever/guard that referenced this issue Jan 27, 2012
@thibaudgg
Copy link
Member

Merged, thanks to @Maher4Ever !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants