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

Already on GitHub? Sign in to your account

Move ~/.guard.rb and ~/.Guardfile files to ~/.guard/ directory #272

Maher4Ever opened this Issue Apr 9, 2012 · 8 comments


None yet
5 participants

Maher4Ever commented Apr 9, 2012

Hello everyone,

Guard has two files now for extra configurations as you know. The first one is ~/.Guardfile and the second one is ~/.guard.rb. Four months ago though a new feature was added to define templates for guard's implementations in ~/.guard/templates/.

Since Guard already uses the ~/.guard/ directory, I think it would be better to move all user configurations to that directory. I also think we could change the name of ~/.guard.rb to ~/.guard/shared.rb which better describes the purpose of that file.

We could also change file ~/.Guardfile to just ~/.guard/Guardfile, but that would make ~/.guard/ unwatchable by Guard!

Of course, the old files would be deprecated in the beginning until they get removed when its time for it.

To summarize: Guard already "reserves" the ~/.guard/ directory, thus we could store all configurations there.


While playing with the feature of defining templates in ~/.guard/templates, I found out that the Guardfile for a given implementation must use the name of the implementation. So to define a template for rspec to use when calling guard init rspec, one should create a file ~/.guard/templates/rspec. Also, if guard-rspec is already installed, it wouldn't be used.

Wouldn't it be nicer to store the templates in a directory for the implementation instead? So ~/.guard/templates/rspec would become ~/.guard/templates/rspec/Guardfile and use it if it's found instead of the default one that comes with the implementation? That way one could define the template one time there and never have to change it again.


thibaudgg commented Apr 11, 2012

Sounds good to me, we can do that in Guard 1.1 (alongs Listen integration)


netzpirat commented Apr 11, 2012

+1 for moving all the configs to the .guard directory.


Maher4Ever commented Apr 11, 2012

Great! Hopefully this change will make it into Guard 1.1 :)


rymai commented Jun 3, 2012

No it didn't! :P

What's the milestone for this? 1.2.0?


thibaudgg commented Jun 3, 2012

Yep 1.2!


Maher4Ever commented Jun 3, 2012

That sounds good. I started working on this feature at the HackDay, but I didn't finish it yet :).

@ghost ghost assigned Maher4Ever Jun 5, 2012

👍 and bump!


netzpirat commented Oct 30, 2012

Since @Maher4Ever is very, very busy lately with other stuff and nobody else want to take care of it, I'm closing this. If someone is still interested in putting some work into it, please open a pull request :P

@netzpirat netzpirat closed this Oct 30, 2012

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