Class: Phare::Check
- Inherits:
-
Object
- Object
- Phare::Check
- Defined in:
- lib/phare/check.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(directory) ⇒ Check
constructor
A new instance of Check.
- #run ⇒ Object
Constructor Details
#initialize(directory) ⇒ Check
Returns a new instance of Check.
5 6 7 8 |
# File 'lib/phare/check.rb', line 5 def initialize(directory) @directory = directory @directory << '/' unless @directory.end_with?('/') end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/phare/check.rb', line 3 def status @status end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/phare/check.rb', line 10 def run @checks = [] @checks << ruby = Checks::RubyRubocop.new ruby.run @checks << scsslint = Checks::ScssLint.new(@directory) scsslint.run @checks << jshint = Checks::JavaScriptJSHint.new(@directory) jshint.run @checks << jscs = Checks::JavaScriptJSCS.new(@directory) jscs.run @status = @checks.map!(&:status).find { |status| status > 0 } || 0 end |