Revert "remove old code for rails 3x and update haml dependency"

This commit is contained in:
Ruslan Korolev 2015-01-31 14:34:18 +03:00
parent d064e8d55e
commit 4ef4dedfaf
2 changed files with 7 additions and 2 deletions

View File

@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.rubyforge_project = "haml-rails"
s.required_rubygems_version = ">= 1.3.6"
s.add_dependency "haml", [">= 4.0.6", "< 5.0"]
s.add_dependency "haml", [">= 3.1", "< 5.0"]
s.add_dependency "activesupport", [">= 4.0.1"]
s.add_dependency "actionpack", [">= 4.0.1"]
s.add_dependency "railties", [">= 4.0.1"]

View File

@ -7,9 +7,14 @@ module Haml
class Engine < ::Rails::Engine
end
class Railtie < ::Rails::Railtie
config.app_generators.template_engine :haml
if ::Rails.version.to_s >= "3.1"
config.app_generators.template_engine :haml
else
config.generators.template_engine :haml
end
config.before_initialize do
Haml.init_rails(binding)
Haml::Template.options[:format] = :html5
end