Sha256: 6ba54b550895e1c201f6725b89d33f92ce88d1dd59e9a58117abd04af24f0b00

Contents?: true

Size: 483 Bytes

Versions: 6

Compression:

Stored size: 483 Bytes

Contents

require 'gettext_i18n_rails/base_parser'

module GettextI18nRails
  class HamlParser < BaseParser
    def self.extension
      "haml"
    end

    def self.convert_to_code(text)
      case @library_loaded
      when "haml"
        Haml::Engine.new(text).precompiled()
      when "hamlit"
        Hamlit::Engine.new.call(text)
      end
    end

    def self.libraries
      ["haml", "hamlit"]
    end
  end
end

GettextI18nRails::GettextHooks.add_parser GettextI18nRails::HamlParser

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gettext_i18n_rails-1.8.1 lib/gettext_i18n_rails/haml_parser.rb
gettext_i18n_rails-1.8.0 lib/gettext_i18n_rails/haml_parser.rb
gettext_i18n_rails-1.7.2 lib/gettext_i18n_rails/haml_parser.rb
gettext_i18n_rails-1.7.1 lib/gettext_i18n_rails/haml_parser.rb
gettext_i18n_rails-1.7.0 lib/gettext_i18n_rails/haml_parser.rb
gettext_i18n_rails-1.6.0 lib/gettext_i18n_rails/haml_parser.rb