Class: Phare::Checks::RubyRubocop

Inherits:
Object
  • Object
show all
Defined in:
lib/phare/checks/ruby_rubocop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRubyRubocop

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

#statusObject (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

#runObject



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?
    print_banner
    system(@command)
    @status = $CHILD_STATUS.exitstatus

    unless @status == 0
      puts "Something went wrong. Program exited with #{@status}"
    end

    puts ''
  else
    @status = 0
  end
end