Facade for the Guard command line interface managed by [Thor](github.com/wycats/thor). This is the main interface to Guard that is called by the Guard binary `bin/guard`. Do not put any logic in here, create a class and delegate instead.
Initializes the templates of all installed Guard plugins and adds them to the `Guardfile` when no Guard name is passed. When passing Guard plugin names it does the same but only for those Guard plugins.
@see Guard::Guardfile.initialize_template @see Guard::Guardfile.initialize_all_templates
@param [Array<String>] plugin_names the name of the Guard plugins to initialize
# File lib/guard/cli.rb, line 165 def init(*plugin_names) _verify_bundler_presence ::Guard::Guardfile.create_guardfile(abort_on_existence: options[:bare]) return if options[:bare] if plugin_names.empty? ::Guard::Guardfile.initialize_all_templates else plugin_names.each do |plugin_name| ::Guard::Guardfile.initialize_template(plugin_name) end end end
List the Guard plugins that are available for use in your system and marks those that are currently used in your `Guardfile`.
# File lib/guard/cli.rb, line 123 def list ::Guard::DslDescriber.new(options).list end
List the Notifiers for use in your system.
@see Guard::DslDescriber.notifiers
# File lib/guard/cli.rb, line 133 def notifiers ::Guard::DslDescriber.new(options).notifiers end
Shows all Guard plugins and their options that are defined in the `Guardfile`
# File lib/guard/cli.rb, line 189 def show ::Guard::DslDescriber.new(options).show end
Start Guard by initializing the defined Guard plugins and watch the file system. This is the default task, so calling `guard` is the same as calling `guard start`.
@see Guard.start
# File lib/guard/cli.rb, line 105 def start _verify_bundler_presence unless options[:no_bundler_warning] ::Guard.start(options) return if ENV['GUARD_ENV'] == 'test' while ::Guard.running do sleep 0.5 end end
Shows the current version of Guard.
@see Guard::VERSION
# File lib/guard/cli.rb, line 144 def version puts "Guard version #{ ::Guard::VERSION }" end
Generated with the Darkfish Rdoc Generator 2.