jammit 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/jammit.gemspec +2 -2
- data/lib/jammit.rb +1 -1
- data/lib/jammit/compressor.rb +4 -3
- metadata +2 -2
data/jammit.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'jammit'
|
3
|
-
s.version = '0.2.
|
4
|
-
s.date = '2009-11-
|
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"
|
data/lib/jammit.rb
CHANGED
data/lib/jammit/compressor.rb
CHANGED
@@ -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
|
-
|
96
|
-
|
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.
|
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.
|
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-
|
12
|
+
date: 2009-11-24 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|