summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorconnorshea <connor.james.shea@gmail.com>2016-04-11 15:27:07 -0600
committerConnor Shea <connor.james.shea@gmail.com>2016-06-22 16:09:51 -0600
commit80f576bb8aaab83ca78a21f20c03cb4b4fb18f11 (patch)
tree0675078c6192026dfeac14fab6631a2a0de71f76 /config
parent69479d3615df62c0c6c22fe20263413505b2ef8f (diff)
downloadgitlab-ce-80f576bb8aaab83ca78a21f20c03cb4b4fb18f11.tar.gz
Replace Haml with Hamlit.
Hamlit is a library that's faster than Haml while implementing most of its features: https://github.com/k0kubun/hamlit Not sure if this breaks anything, but as far as I can tell most things work the same. No obvious regressions that I've been able to find.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/haml.rb7
-rw-r--r--config/initializers/hamlit.rb15
2 files changed, 15 insertions, 7 deletions
diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb
deleted file mode 100644
index 1516476815a..00000000000
--- a/config/initializers/haml.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-Haml::Template.options[:ugly] = true
-
-# Remove the `:coffee` and `:coffeescript` filters
-#
-# See https://git.io/vztMu and http://stackoverflow.com/a/17571242/223897
-Haml::Filters.remove_filter('coffee')
-Haml::Filters.remove_filter('coffeescript')
diff --git a/config/initializers/hamlit.rb b/config/initializers/hamlit.rb
new file mode 100644
index 00000000000..259d562e586
--- /dev/null
+++ b/config/initializers/hamlit.rb
@@ -0,0 +1,15 @@
+module Hamlit
+ class TemplateHandler
+ def call(template)
+ Engine.new(
+ generator: Temple::Generators::RailsOutputBuffer,
+ attr_quote: '"',
+ ).call(template.source)
+ end
+ end
+end
+
+ActionView::Template.register_template_handler(
+ :haml,
+ Hamlit::TemplateHandler.new,
+)