Class: BestPracticeProject::HamlLintHandler

Inherits:
BaseHandler
  • Object
show all
Defined in:
lib/best_practice_project/haml_lint_handler.rb

Instance Method Summary collapse

Methods inherited from BaseHandler

#initialize, #rails?

Constructor Details

This class inherits a constructor from BestPracticeProject::BaseHandler

Instance Method Details

#commandObject



14
15
16
# File 'lib/best_practice_project/haml_lint_handler.rb', line 14

def command
  @command ||= "bundle exec haml-lint app"
end

#executeObject



18
19
20
# File 'lib/best_practice_project/haml_lint_handler.rb', line 18

def execute
  system(command)
end

#generate_configObject



9
10
11
12
# File 'lib/best_practice_project/haml_lint_handler.rb', line 9

def generate_config
  puts "HamlLintHandler: Copying standard config"
  FileUtils.copy(bpp_config_path, config_path)
end

#installed?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
# File 'lib/best_practice_project/haml_lint_handler.rb', line 2

def installed?
  require "haml_lint"
  true
rescue LoadError
  false
end