Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Initialize all guards at once #227

Closed
rupert654 opened this Issue · 5 comments

2 participants

@rupert654

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
Owner

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

@rupert654

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
Owner

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
Owner

@rupert654 any news?

@thibaudgg
Owner

Merged, thanks to @Maher4Ever !

@thibaudgg thibaudgg closed this
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.