In Files

Parent

Files

Guard::CLI

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.

Public Instance Methods

init(*plugin_names) click to toggle source

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() click to toggle source

List the Guard plugins that are available for use in your system and marks those that are currently used in your `Guardfile`.

@see Guard::DslDescriber.list

# File lib/guard/cli.rb, line 123
def list
  ::Guard::DslDescriber.new(options).list
end
notifiers() click to toggle source

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
show() click to toggle source

Shows all Guard plugins and their options that are defined in the `Guardfile`

@see Guard::DslDescriber.show

# File lib/guard/cli.rb, line 189
def show
  ::Guard::DslDescriber.new(options).show
end
start() click to toggle source

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
version() click to toggle source

Shows the current version of Guard.

@see Guard::VERSION

# File lib/guard/cli.rb, line 144
def version
  puts "Guard version #{ ::Guard::VERSION }"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.