Module: Middleman::Features::MinifyJavascript::Haml::Javascript

Defined in:
lib/middleman/features/minify_javascript.rb

Instance Method Summary collapse

Instance Method Details

#render_with_options(text, options) ⇒ Object



14
15
16
17
18
# File 'lib/middleman/features/minify_javascript.rb', line 14

def render_with_options(text, options)
  compressor = ::YUI::JavaScriptCompressor.new(:munge => true)
  data = compressor.compress(text)
  %Q{<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>#{data.chomp}</script>}
end