class Guard::PluginUtil
def add_to_guardfile
Adds a plugin's template to the Guardfile.
def add_to_guardfile if ::Guard.evaluator.guardfile_include?(name) ::Guard::UI.info "Guardfile already includes #{ name } guard" else content = File.read('Guardfile') File.open('Guardfile', 'wb') do |f| f.puts(content) f.puts('') f.puts(plugin_class.template(plugin_location)) end ::Guard::UI.info "#{ name } guard added to Guardfile, feel free to edit it" end end