jammit 0.2.8 → 0.2.9

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.2.8' # Keep version in sync with jammit.rb
4
- s.date = '2009-11-23'
3
+ s.version = '0.2.9' # Keep version in sync with jammit.rb
4
+ s.date = '2009-11-24'
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.2.8"
7
+ VERSION = "0.2.9"
8
8
 
9
9
  ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
10
10
 
@@ -92,8 +92,9 @@ module Jammit
92
92
  def concatenate_and_tag_images(paths, variant=nil)
93
93
  stylesheets = [paths].flatten.map do |css_path|
94
94
  File.read(css_path).gsub(IMAGE_DETECTOR) do |url|
95
- new_path = rewrite_image_path(Pathname.new($1), Pathname.new(File.expand_path(css_path)), !!variant)
96
- "url(#{new_path})"
95
+ ipath, cpath = Pathname.new($1), Pathname.new(File.expand_path(css_path))
96
+ is_url = URI.parse($1).absolute?
97
+ is_url ? url : "url(#{rewrite_image_path(ipath, cpath, !!variant)})"
97
98
  end
98
99
  end
99
100
  stylesheets.join("\n")
@@ -129,7 +130,7 @@ module Jammit
129
130
  def rewrite_image_path(image_path, css_path, embed=false)
130
131
  public_path = absolute_path(image_path, css_path)
131
132
  return "__EMBED__#{public_path}" if embed && embeddable?(public_path)
132
- image_path.relative? ? relative_path(public_path) : image_path.to_s
133
+ image_path.absolute? ? image_path.to_s : relative_path(public_path)
133
134
  end
134
135
 
135
136
  # Get the site-absolute public path for an image file path that may or may
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jammit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Ashkenas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-23 00:00:00 -05:00
12
+ date: 2009-11-24 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency