Class: Aid::Scripts::Doctor::CommandRemedy

Inherits:
Remedy
  • Object
show all
Includes:
Colorize
Defined in:
lib/aid/scripts/doctor.rb

Constant Summary

Constants included from Colorize

Colorize::COLOR_CODES

Instance Method Summary collapse

Methods included from Colorize

colorize, included

Constructor Details

#initialize(shell_command) ⇒ CommandRemedy

Returns a new instance of CommandRemedy.



90
91
92
# File 'lib/aid/scripts/doctor.rb', line 90

def initialize(shell_command)
  super
end

Instance Method Details

#auto_fix!Object



98
99
100
101
# File 'lib/aid/scripts/doctor.rb', line 98

def auto_fix!
  puts "==> running #{colorize(:command, "$ #{shell_command}")}"
  system(shell_command)
end

#auto_fixable?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/aid/scripts/doctor.rb', line 94

def auto_fixable?
  true
end

#to_sObject



103
104
105
# File 'lib/aid/scripts/doctor.rb', line 103

def to_s
  "run #{colorize :command, shell_command}"
end