Skip to content

Commit e109bd2

Browse files
committed
Jammit 0.6.2 -- Rails 3.1 bugfix.
1 parent f438619 commit e109bd2

4 files changed

Lines changed: 20 additions & 11 deletions

File tree

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
</p>
9494

9595
<p>
96-
<b>Current Version:</b> <a href="http://rubygems.org/gems/jammit/">0.6.1</a>
96+
<b>Current Version:</b> <a href="http://rubygems.org/gems/jammit/">0.6.2</a>
9797
</p>
9898

9999
<p>
@@ -692,6 +692,13 @@ <h2 id="jst">JavaScript Templates</h2>
692692

693693
<h2 id="changes">Change Log</h2>
694694

695+
<p>
696+
<b class="header">0.6.2</b> &mdash; <small><i>May 26, 2011</i></small><br />
697+
Quick bugfix release for Rails 3.1 compatibility, which changes the method
698+
signatures of <tt>javascript_include_tag</tt> and <tt>stylesheet_link_tag</tt>
699+
in a backwards-incompatible fashion.
700+
</p>
701+
695702
<p>
696703
<b class="header">0.6.1</b> &mdash; <small><i>May 25, 2011</i></small><br />
697704
Jammit now supports <b>UglifyJS</b> as a Java-free alternative to YUI and Closure,

jammit.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22
s.name = 'jammit'
3-
s.version = '0.6.1' # Keep version in sync with jammit.rb
4-
s.date = '2011-05-25'
3+
s.version = '0.6.2' # Keep version in sync with jammit.rb
4+
s.date = '2011-05-26'
55

66
s.homepage = "http://documentcloud.github.com/jammit/"
77
s.summary = "Industrial Strength Asset Packaging for Rails"

lib/jammit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# to all of the configuration options.
55
module Jammit
66

7-
VERSION = "0.6.1"
7+
VERSION = "0.6.2"
88

99
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
1010

lib/jammit/helper.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)