Class: PolishGeeks::DevTools::Commands::HamlLint
- Defined in:
- lib/polish_geeks/dev_tools/commands/haml_lint.rb
Overview
Command wrapper for Haml lint validation It informs us if haml is formatted in a proper way
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#execute ⇒ String
Executes this command.
-
#valid? ⇒ Boolean
True if there were no Rubocop offenses detected.
Methods inherited from Base
#ensure_executable!, #error_message
Instance Method Details
#execute ⇒ String
Executes this command
12 13 14 15 16 17 18 19 |
# File 'lib/polish_geeks/dev_tools/commands/haml_lint.rb', line 12 def execute loc_config = File.join(DevTools.gem_root, 'config', 'haml-lint.yml') app_config = File.join(DevTools.app_root, '.haml-lint.yml') config = File.exist?(app_config) ? app_config : loc_config @output = Shell.new.execute("bundle exec haml-lint -c #{config} app/views") end |
#valid? ⇒ Boolean
Returns true if there were no Rubocop offenses detected.
22 23 24 |
# File 'lib/polish_geeks/dev_tools/commands/haml_lint.rb', line 22 def valid? @output.to_s.empty? end |