Class: Phare::Check::Stylelint

Inherits:
Phare::Check show all
Defined in:
lib/phare/check/stylelint.rb

Constant Summary collapse

GLOBAL_BINARY =
'stylelint'.freeze
LOCAL_BINARY =
'node_modules/.bin/stylelint'.freeze

Instance Attribute Summary collapse

Attributes inherited from Phare::Check

#status, #tree

Instance Method Summary collapse

Methods inherited from Phare::Check

#run, #should_run?

Constructor Details

#initialize(directory, options = {}) ⇒ Stylelint

Returns a new instance of Stylelint.



10
11
12
13
14
15
16
17
18
# File 'lib/phare/check/stylelint.rb', line 10

def initialize(directory, options = {})
  @directory = directory
  @config = File.expand_path("#{directory}.stylelintrc", __FILE__)
  @path = File.expand_path("#{directory}app/assets/stylesheets", __FILE__)
  @extensions = %w(.scss)
  @options = options

  super
end

Instance Attribute Details

#config ⇒ Object (readonly)

Returns the value of attribute config.



8
9
10
# File 'lib/phare/check/stylelint.rb', line 8

def config
  @config
end

#path ⇒ Object (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/phare/check/stylelint.rb', line 8

def path
  @path
end

Instance Method Details

#command ⇒ Object



20
21
22
# File 'lib/phare/check/stylelint.rb', line 20

def command
  "#{binary} #{input}"
end