class Guard::Interactor
Attributes
enabled[W]
TODO: handle switching interactors during runtime?
options[W]
Pass options to interactor's job when it's created
idle_job[R]
Public Class Methods
enabled?()
click to toggle source
TODO: allow custom user idle jobs, e.g. [:pry, :sleep, :exit, …]
# File lib/guard/interactor.rb, line 39 def enabled? @enabled || @enabled.nil? end
Also aliased as: enabled
new(no_interaction = false)
click to toggle source
Initializes the interactor. This configures Pry and creates some custom commands and aliases for Guard
.
# File lib/guard/interactor.rb, line 9 def initialize(no_interaction = false) @interactive = !no_interaction && self.class.enabled? # TODO: only require the one used require "guard/jobs/sleep" require "guard/jobs/pry_wrapper" job_klass = interactive? ? Jobs::PryWrapper : Jobs::Sleep @idle_job = job_klass.new(self.class.options) end
options()
click to toggle source
# File lib/guard/interactor.rb, line 31 def options @options ||= {} end
Public Instance Methods
interactive?()
click to toggle source
# File lib/guard/interactor.rb, line 20 def interactive? @interactive end