Class: Guard::Sorbet

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

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Sorbet

Returns a new instance of Sorbet.



11
12
13
14
15
16
# File 'lib/guard/sorbet.rb', line 11

def initialize(options = nil)
  super(options)

  @version = T.let('0.0.1', String)
  @sorbet_version = T.let(Gem.loaded_specs['sorbet'].version.to_s, String)
end

Instance Method Details

#run_allObject



19
20
21
22
23
24
25
26
# File 'lib/guard/sorbet.rb', line 19

def run_all
  Compat::UI.info "Guard::Sorbet #{@version} is running, with Sorbet #{@sorbet_version}"
  srb_path = Gem.bin_path 'sorbet', 'srb'
  if !system(srb_path)
    Compat::UI.error "srb failed"
    throw :task_has_failed
  end
end

#run_on_modifications(_) ⇒ Object



34
35
36
# File 'lib/guard/sorbet.rb', line 34

def run_on_modifications(_)
  run_all
end

#startObject



29
30
31
# File 'lib/guard/sorbet.rb', line 29

def start
  run_all
end