Class: Phare::Checks::RubyRubocop
- Inherits:
-
Object
- Object
- Phare::Checks::RubyRubocop
- Defined in:
- lib/phare/checks/ruby_rubocop.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize ⇒ RubyRubocop
constructor
A new instance of RubyRubocop.
- #run ⇒ Object
Constructor Details
#initialize ⇒ RubyRubocop
Returns a new instance of RubyRubocop.
6 7 8 |
# File 'lib/phare/checks/ruby_rubocop.rb', line 6 def initialize @command = 'rubocop' end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/phare/checks/ruby_rubocop.rb', line 4 def status @status end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/phare/checks/ruby_rubocop.rb', line 10 def run if should_run? system(@command) @status = $CHILD_STATUS.exitstatus unless @status == 0 puts "Something went wrong. Program exited with #{@status}" end puts '' else @status = 0 end end |