Sha256: c903e1f934529bfe3510fdfe5a159a1973e17f037edddb443441c7012f8a1a9b

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

class BestPracticeProject::HamlLintHandler < BestPracticeProject::BaseHandler
  def installed?
    require "haml_lint"
    true
  rescue LoadError
    false
  end

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

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

  def execute
    system(command)
  end

private

  def bpp_config_path
    @bpp_config_path ||= File.realpath("#{File.dirname(__FILE__)}/config/haml-lint.yml")
  end

  def config_path
    @config_path ||= Rails.root.join(".haml-lint.yml").to_s
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
best_practice_project-0.0.12 lib/best_practice_project/haml_lint_handler.rb
best_practice_project-0.0.11 lib/best_practice_project/haml_lint_handler.rb
best_practice_project-0.0.10 lib/best_practice_project/haml_lint_handler.rb
best_practice_project-0.0.9 lib/best_practice_project/haml_lint_handler.rb
best_practice_project-0.0.8 lib/best_practice_project/haml_lint_handler.rb