@@ -25,10 +25,11 @@ def include_stylesheets(*packages)
2525 # Writes out the URL to the bundled and compressed javascript package,
2626 # except in development, where it references the individual scripts.
2727 def include_javascripts ( *packages )
28- tags = packages . map do |pack |
28+ html_safe packages . map { |pack |
2929 should_package? ? Jammit . asset_url ( pack , :js ) : Jammit . packager . individual_urls ( pack . to_sym , :js )
30- end
31- html_safe ( javascript_include_tag ( tags . flatten ) )
30+ } . flatten . map { |pack |
31+ javascript_include_tag pack
32+ } . join ( "\n " )
3233 end
3334
3435 # Writes out the URL to the concatenated and compiled JST file -- we always
@@ -71,10 +72,11 @@ def embedded_image_stylesheets(packages, options)
7172 # Generate the stylesheet tags for a batch of packages, with options, by
7273 # yielding each package to a block.
7374 def tags_with_options ( packages , options )
74- packages = packages . dup
75- packages . map! { |package | yield package } . flatten!
76- packages . push ( options ) unless options . empty?
77- stylesheet_link_tag ( *packages )
75+ packages . dup . map { |package |
76+ yield package
77+ } . flatten . map { |package |
78+ stylesheet_link_tag package , options
79+ } . join ( "\n " )
7880 end
7981
8082 end
0 commit comments