class Guard::CLI


Do not put any logic in here, create a class and delegate instead.
This is the main interface to Guard that is called by the Guard binary ‘bin/guard`.
Facade for the Guard command line interface managed by [Thor](github.com/wycats/thor).

def init(guard_name = nil)

Parameters:
  • guard_name (String) -- the name of the Guard to initialize

Other tags:
    See: Guard.initialize_template -
def init(guard_name = nil)
  verify_bundler_presence
  ::Guard.initialize_template(guard_name)
end

def list

Other tags:
    See: Guard::DslDescriber.list -
def list
  verify_bundler_presence
  ::Guard::DslDescriber.list(options)
end

def show

Other tags:
    See: Guard::DslDescriber.show -
def show
  verify_bundler_presence
  ::Guard::DslDescriber.show(options)
end

def start

Other tags:
    See: Guard.start -
def start
  verify_bundler_presence
  ::Guard.start(options)
rescue Interrupt
  ::Guard.stop
  abort
end

def verify_bundler_presence


shows a hint to do so if not.
Verifies if Guard is run with `bundle exec` and
def verify_bundler_presence
  ::Guard::UI.warning "You are using Guard outside of Bundler, this is dangerous and could not work. Using `bundle exec guard` is safer." unless ENV['BUNDLE_GEMFILE']
end

def version

Other tags:
    See: Guard::VERSION -
def version
  verify_bundler_presence
  ::Guard::UI.info "Guard version #{ ::Guard::VERSION }"
end