Class: Guard::Srb

Inherits:
Plugin
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/guard/srb.rb,
lib/guard/srb/runner.rb

Defined Under Namespace

Classes: Runner

Constant Summary collapse

DEFAULT_OPTIONS =
T.let(
  {
    all_on_start: true,
    notification: :failed,
    hide_stdout: false,
    colorize: "always"
  }.freeze,
  T::Hash[Symbol, T.untyped]
)

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Srb

Returns a new instance of Srb.



25
26
27
28
# File 'lib/guard/srb.rb', line 25

def initialize(options = {})
  super
  @options = T.let(DEFAULT_OPTIONS.merge(@options), T::Hash[Symbol, T.untyped])
end

Instance Method Details

#run_allObject



36
37
38
39
# File 'lib/guard/srb.rb', line 36

def run_all
  UI.info "Typechecking all files"
  inspect_with_sorbet
end

#run_on_additions(paths) ⇒ Object



42
43
44
# File 'lib/guard/srb.rb', line 42

def run_on_additions(paths)
  run_partially(paths)
end

#run_on_modifications(paths) ⇒ Object



47
48
49
# File 'lib/guard/srb.rb', line 47

def run_on_modifications(paths)
  run_partially(paths)
end

#startObject



31
32
33
# File 'lib/guard/srb.rb', line 31

def start
  run_all if @options[:all_on_start]
end