css_sprite 1.4.9 → 1.4.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +9 -0
- data/VERSION +1 -1
- data/css_sprite.gemspec +4 -4
- data/lib/css_sprite/sprite.rb +5 -2
- metadata +4 -4
data/README.textile
CHANGED
@@ -93,6 +93,15 @@ css_sprite uses RMagick to compose the images by default. It uses PaletteMatteTy
|
|
93
93
|
|
94
94
|
Check the detailed information of image_type here: http://www.imagemagick.org/RMagick/doc/constants.html#ImageType
|
95
95
|
|
96
|
+
h3. Destination Image Format
|
97
|
+
|
98
|
+
css_sprite saves the css sprite image as a png file by default. You can change it to gif or any other format like
|
99
|
+
|
100
|
+
<pre><code>
|
101
|
+
image_type: TrueColorMatteType
|
102
|
+
format: GIF
|
103
|
+
</code></pre>
|
104
|
+
|
96
105
|
h3. Sass
|
97
106
|
|
98
107
|
css_sprite generates css file by default. If you like sass, you can just add following line in the configuration file.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.10
|
data/css_sprite.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{css_sprite}
|
8
|
-
s.version = "1.4.
|
8
|
+
s.version = "1.4.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Richard Huang"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-13}
|
13
13
|
s.description = %q{css_sprite is a rails plugin/gem to generate css sprite image automatically.}
|
14
14
|
s.email = %q{flyerhzm@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -49,8 +49,8 @@ Gem::Specification.new do |s|
|
|
49
49
|
s.rubygems_version = %q{1.3.6}
|
50
50
|
s.summary = %q{css_sprite is a rails plugin/gem to generate css sprite image automatically.}
|
51
51
|
s.test_files = [
|
52
|
-
"spec/
|
53
|
-
"spec/
|
52
|
+
"spec/css_sprite/sprite_spec.rb",
|
53
|
+
"spec/spec_helper.rb"
|
54
54
|
]
|
55
55
|
|
56
56
|
if s.respond_to? :specification_version then
|
data/lib/css_sprite/sprite.rb
CHANGED
@@ -14,6 +14,8 @@ class Sprite
|
|
14
14
|
|
15
15
|
@image_path = File.expand_path(File.join(Rails.root, @config['image_path'] || 'public/images'))
|
16
16
|
@stylesheet_path = File.expand_path(File.join(Rails.root, @config['stylesheet_path'] || 'public/stylesheets'))
|
17
|
+
|
18
|
+
@format = @config['format'] ? @config['format'].downcase() : "png"
|
17
19
|
end
|
18
20
|
|
19
21
|
# execute the css sprite operation
|
@@ -100,6 +102,7 @@ class Sprite
|
|
100
102
|
dest_image = composite_images(dest_image, source_image, x, y)
|
101
103
|
end
|
102
104
|
dest_image.image_type = @config['image_type'] ? Magick.const_get(@config['image_type']) : Magick::PaletteMatteType
|
105
|
+
dest_image.format = @config['format'] || "PNG"
|
103
106
|
dest_image.write(dest_image_path)
|
104
107
|
end
|
105
108
|
results
|
@@ -242,12 +245,12 @@ class Sprite
|
|
242
245
|
|
243
246
|
# destination css sprite image path
|
244
247
|
def dest_image_path(directory)
|
245
|
-
directory + ".
|
248
|
+
directory + "." + @format
|
246
249
|
end
|
247
250
|
|
248
251
|
# destination css sprite image name
|
249
252
|
def dest_image_name(directory)
|
250
|
-
File.basename(directory) + ".
|
253
|
+
File.basename(directory) + "." + @format
|
251
254
|
end
|
252
255
|
|
253
256
|
# destination css file path
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
8
|
+
- 10
|
9
|
+
version: 1.4.10
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Richard Huang
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-13 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -95,5 +95,5 @@ signing_key:
|
|
95
95
|
specification_version: 3
|
96
96
|
summary: css_sprite is a rails plugin/gem to generate css sprite image automatically.
|
97
97
|
test_files:
|
98
|
-
- spec/spec_helper.rb
|
99
98
|
- spec/css_sprite/sprite_spec.rb
|
99
|
+
- spec/spec_helper.rb
|