Class: Phare::Checks::ScssLint
- Inherits:
-
Object
- Object
- Phare::Checks::ScssLint
- Defined in:
- lib/phare/checks/scss_lint.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(directory) ⇒ ScssLint
constructor
A new instance of ScssLint.
- #run ⇒ Object
Constructor Details
#initialize(directory) ⇒ ScssLint
Returns a new instance of ScssLint.
6 7 8 9 10 |
# File 'lib/phare/checks/scss_lint.rb', line 6 def initialize(directory) @path = File.("#{directory}app/assets/stylesheets", __FILE__) @glob = File.join(@path, '**/*.css.scss') @command = "scss-lint #{@glob}" end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/phare/checks/scss_lint.rb', line 4 def status @status end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/phare/checks/scss_lint.rb', line 12 def run if should_run? system(@command) @status = $CHILD_STATUS.exitstatus if @status == 0 puts 'No code style errors found.' else puts "Something went wrong. Program exited with #{@status}" end puts '' else @status = 0 end end |