css_sprite 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -1,6 +1,6 @@
1
1
  h1. css_sprite
2
2
 
3
- A rails plugin/gem to generate css sprite images automatically.
3
+ automatically css sprite.
4
4
 
5
5
  *************************************************************************
6
6
 
@@ -12,26 +12,43 @@ I have rewritten the plugin. Please check out the gem version >= 1.3.0
12
12
 
13
13
  h2. Install
14
14
 
15
- css_sprite is dependent on the <code>rmagick</code> gem, please install it first.
16
-
15
+ css_sprite depends on the <code>rmagick</code> gem, please make sure RMagick is successfully installed on your system.
17
16
 
18
17
  install css_sprite as a gem:
19
- <pre><code>
20
- sudo gem install css_sprite
21
- </code></pre>
18
+ <pre><code>sudo gem install css_sprite</code></pre>
22
19
 
23
20
  or install css_sprite as a plugin:
24
- <pre><code>
25
- script/plugin install git://github.com/flyerhzm/css_sprite.git
26
- </code></pre>
21
+ <pre><code>script/plugin install git://github.com/flyerhzm/css_sprite.git</code></pre>
27
22
 
28
23
  **************************************************************************
29
24
 
30
- h2. Configuration
25
+ h2. Usage
26
+
27
+ 1. create a directory whose name is css_sprite or ends with css_sprite (e.g. widget_css_sprite) under <code>public/images</code> directory
28
+
29
+ 2. if you install the css_sprite as a gem, you should add css_sprite task in Rakefile
30
+ <pre><code>require 'css_sprite'</code></pre>
31
+ If you install it as a plugin, you can skip this step
32
+
33
+ 2. define <code>config/css_sprite.yml</code>, it is not necessary by default.
34
+
35
+ 3. start css_sprite server
36
+ <pre><code>rake css_sprite:start</code></pre>
37
+
38
+ 4. put any images which you need to do the css sprite under the css_sprite directory, then you will see the automatically generated css sprite image and css files.
39
+
40
+ 5. include the stylesheet in your view page
41
+ <pre><code><%= stylesheet_link_tag 'css_sprite' %></code></pre>
42
+
43
+ You can stop the css_sprite server by <code>rake css_sprite:stop</code>
31
44
 
32
- There is no need to create any configuration if you do not use sass and you do not want any customization.
45
+ Or you can just do the css sprite manually by <code>rake css_sprite:build</code>
33
46
 
34
- But you can create <code>config/css_sprite.yml</code> to define the customization.
47
+ **************************************************************************
48
+
49
+ h2. Configuration
50
+
51
+ There is no need to create any configuration by default. If you want to use sass or you want to define common styles for some related classes, you need to define <code>config/css_sprite.yml</code> file.
35
52
 
36
53
  h3. Examples
37
54
 
@@ -46,7 +63,6 @@ suffix:
46
63
  line-height: 15px;
47
64
  border: 0;
48
65
  outline: 0;
49
-
50
66
  icon: |
51
67
  text-indent: -9999px;
52
68
  cursor: pointer;
@@ -64,36 +80,22 @@ suffix:
64
80
  line-height: 15px
65
81
  border: 0
66
82
  outline: 0
67
-
68
83
  icon: |
69
84
  text-indent: -9999px
70
85
  cursor: pointer
71
86
  </code></pre>
72
87
 
73
- <code>engine</code> defines css (default) or sass to generate.
88
+ <code>engine</code> defines css (default) or sass file to generate.
74
89
  <code>suffix</code> defines the customization styles for specified images.
75
- The customization above means if suffix of your image filename is button (e.g. post_button.png), it contains the additional style with (outline: 0; border: 0; and so on),
76
- if suffix of your image filename is icon (e.g. twitter_icon.png), it contains the additional style with (text-indent: -9999px; cursor: pointer)
90
+ The customization above means if your image filename is button suffixed (e.g. post_button.png), the corresponding class .post_button has the additional style with (outline: 0; border: 0; and so on),
91
+ if your image filename is icon suffixed (e.g. twitter_icon.png), the correspondiing class .twitter_icon has the additional style with (text-indent: -9999px; cursor: pointer)
77
92
 
78
93
  **************************************************************************
79
94
 
80
- h2. Usage
81
-
82
- 1. create a <code>css_sprite</code> directory or css_sprite suffixed directory (e.g. widget_css_sprite) under <code>public/images/</code>
83
-
84
- 2. define <code>config/css_sprite.yml</code> or not
85
-
86
- 3. start css_sprite server <code>rake css_sprite:start</code>
87
-
88
- 4. put any images you want to do css sprite into the css_sprite directory
95
+ h2. Best Practices
89
96
 
90
- 5. then css_sprite image will be automatically generated and css_sprite.css or css_sprite.sass are generated too.
91
-
92
- You can stop top the css_sprite server by <code>rake css_sprite:stop</code>
93
-
94
- Or you just want to do css sprite manually <code>rake css_sprite:build</code>
97
+ I have written a post "css sprite best practices":http://www.huangzhimin.com/entries/190-css-sprite-best-practices to introduce the idea that the css_sprite gem follows.
95
98
 
96
99
  **************************************************************************
97
100
 
98
-
99
101
  Copyright (c) 2009 [Richard Huang (flyerhzm@gmail.com)], released under the MIT license
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ Jeweler::Tasks.new do |gemspec|
15
15
  gemspec.summary = "css_sprite is a rails plugin/gem to generate css sprite image automatically."
16
16
  gemspec.description = "css_sprite is a rails plugin/gem to generate css sprite image automatically."
17
17
  gemspec.email = "flyerhzm@gmail.com"
18
- gemspec.homepage = ""
18
+ gemspec.homepage = "http://github.com/flyerhzm/css_sprite"
19
19
  gemspec.authors = ["Richard Huang"]
20
20
  gemspec.files.exclude '.gitignore'
21
21
  gemspec.add_dependency 'rmagick'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
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.3.1"
8
+ s.version = "1.3.2"
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-04-02}
12
+ s.date = %q{2010-04-07}
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 = [
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  "spec/spec_helper.rb",
37
37
  "tasks/css_sprite_tasks.rake"
38
38
  ]
39
- s.homepage = %q{}
39
+ s.homepage = %q{http://github.com/flyerhzm/css_sprite}
40
40
  s.rdoc_options = ["--charset=UTF-8"]
41
41
  s.require_paths = ["lib"]
42
42
  s.rubygems_version = %q{1.3.6}
@@ -1,3 +1,5 @@
1
+ require 'rbconfig'
2
+
1
3
  namespace :css_sprite do
2
4
  desc "build css sprite image once"
3
5
  task :build do
@@ -8,7 +10,7 @@ namespace :css_sprite do
8
10
  desc "start css sprite server"
9
11
  task :start do
10
12
  automatic_script = File.join(File.dirname(__FILE__), '..', 'lib', 'automatic.rb')
11
- if RUBY_PLATFORM =~ /win|w32/
13
+ if Config::CONFIG['host_os'] =~ /mswin|mingw/
12
14
  exec "start \"css_sprite\" ruby.exe #{automatic_script}"
13
15
  puts "css_sprite server started sucessfully."
14
16
  else
@@ -29,7 +31,7 @@ namespace :css_sprite do
29
31
 
30
32
  desc "stop css sprite server"
31
33
  task :stop do
32
- if RUBY_PLATFORM =~ /win|w32/
34
+ if Config::CONFIG['host_os'] =~ /mswin|mingw/
33
35
  exec "taskkill /im ruby.exe /fi \"Windowtitle eq css_sprite\""
34
36
  puts "css_sprite server shutdown sucessfully."
35
37
  else
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 3
8
- - 1
9
- version: 1.3.1
8
+ - 2
9
+ version: 1.3.2
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-04-02 00:00:00 +08:00
17
+ date: 2010-04-07 00:00:00 +08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -58,7 +58,7 @@ files:
58
58
  - spec/spec_helper.rb
59
59
  - tasks/css_sprite_tasks.rake
60
60
  has_rdoc: true
61
- homepage: ""
61
+ homepage: http://github.com/flyerhzm/css_sprite
62
62
  licenses: []
63
63
 
64
64
  post_install_message: