Class: HamlLint::Adapter
- Inherits:
-
Object
- Object
- HamlLint::Adapter
- Defined in:
- lib/haml_lint/adapter.rb,
lib/haml_lint/adapter/haml_4.rb,
lib/haml_lint/adapter/haml_5.rb,
lib/haml_lint/adapter/haml_6.rb
Overview
Determines the adapter to use for the current Haml version
Defined Under Namespace
Class Method Summary collapse
-
.detect_class ⇒ Class
Detects the adapter to use for the current Haml version.
Class Method Details
.detect_class ⇒ Class
Detects the adapter to use for the current Haml version
19 20 21 22 23 24 25 26 27 |
# File 'lib/haml_lint/adapter.rb', line 19 def self.detect_class version = haml_version case version when '~> 4.0' then HamlLint::Adapter::Haml4 when '~> 5.0', '~> 5.1', '~> 5.2' then HamlLint::Adapter::Haml5 when '~> 6.0', '~> 6.0.a', '~> 6.1' then HamlLint::Adapter::Haml6 else fail HamlLint::Exceptions::UnknownHamlVersion, "Cannot handle Haml version: #{version}" end end |