Class: Phare::Check::JSHint
- Inherits:
-
Phare::Check
- Object
- Phare::Check
- Phare::Check::JSHint
- Defined in:
- lib/phare/check/jshint.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Phare::Check
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(directory, options = {}) ⇒ JSHint
constructor
A new instance of JSHint.
Methods inherited from Phare::Check
Constructor Details
#initialize(directory, options = {}) ⇒ JSHint
Returns a new instance of JSHint.
7 8 9 10 11 12 13 14 15 |
# File 'lib/phare/check/jshint.rb', line 7 def initialize(directory, = {}) @config = File.("#{directory}.jshintrc", __FILE__) @path = File.("#{directory}app/assets/javascripts", __FILE__) @glob = File.join(@path, '**/*') @extensions = %w(.js .es6) = super end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/phare/check/jshint.rb', line 5 def config @config end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/phare/check/jshint.rb', line 5 def path @path end |
Instance Method Details
#command ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/phare/check/jshint.rb', line 17 def command if @tree.changed? "jshint --config #{@config} --extra-ext #{@extensions.join(',')} #{files_to_check.join(' ')}" else "jshint --config #{@config} --extra-ext #{@extensions.join(',')} #{@glob}" end end |