jammit 0.6.1 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  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.3' # Keep version in sync with jammit.rb
4
+ s.date = '2011-05-26'
5
5
 
6
6
  s.homepage = "http://documentcloud.github.com/jammit/"
7
7
  s.summary = "Industrial Strength Asset Packaging for Rails"
@@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path(File.dirname(__FILE__))
4
4
  # to all of the configuration options.
5
5
  module Jammit
6
6
 
7
- VERSION = "0.6.1"
7
+ VERSION = "0.6.3"
8
8
 
9
9
  ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
10
10
 
@@ -63,7 +63,7 @@ Options:
63
63
  opts.on('-f', '--force', 'force a rebuild of all assets') do |force|
64
64
  @options[:force] = force
65
65
  end
66
- opts.on('-p', '--packages PACKAGE_NAMES', 'comma-separated list of packages (ex: "core,embed", default: all packages)') do |package_names|
66
+ opts.on('-p', '--packages LIST', 'list of packages to build (ex: "core,ui", default: all)') do |package_names|
67
67
  @options[:package_names] = package_names.split(/,\s*/).map {|n| n.to_sym }
68
68
  end
69
69
  opts.on_tail('-v', '--version', 'display Jammit version') do
@@ -16,7 +16,7 @@ module Jammit
16
16
  # compressed CSS, and in development the stylesheet URLs are passed verbatim.
17
17
  def include_stylesheets(*packages)
18
18
  options = packages.extract_options!
19
- return individual_stylesheets(packages, options) unless should_package?
19
+ return html_safe(individual_stylesheets(packages, options)) unless should_package?
20
20
  disabled = (options.delete(:embed_assets) == false) || (options.delete(:embed_images) == false)
21
21
  return html_safe(packaged_stylesheets(packages, options)) if disabled || !Jammit.embed_assets
22
22
  return html_safe(embedded_image_stylesheets(packages, options))
@@ -25,10 +25,11 @@ module Jammit
25
25
  # Writes out the URL to the bundled and compressed javascript package,
26
26
  # except in development, where it references the individual scripts.
27
27
  def include_javascripts(*packages)
28
- tags = packages.map do |pack|
28
+ html_safe packages.map {|pack|
29
29
  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")
32
33
  end
33
34
 
34
35
  # Writes out the URL to the concatenated and compiled JST file -- we always
@@ -71,10 +72,11 @@ module Jammit
71
72
  # Generate the stylesheet tags for a batch of packages, with options, by
72
73
  # yielding each package to a block.
73
74
  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")
78
80
  end
79
81
 
80
82
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jammit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Ashkenas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-25 00:00:00 Z
18
+ date: 2011-05-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: yui-compressor