image_bundle 0.0.1 → 0.0.2
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/Gemfile.lock +41 -0
- data/README.md +16 -17
- data/image_bundle.gemspec +1 -0
- data/lib/image_bundle/version.rb +1 -1
- metadata +5 -7
- data/.bzrignore +0 -2
- data/install.rb +0 -1
- data/uninstall.rb +0 -1
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
image_bundle (0.0.2)
|
5
|
+
actionpack (~> 3.0.7)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
abstract (1.0.0)
|
11
|
+
actionpack (3.0.7)
|
12
|
+
activemodel (= 3.0.7)
|
13
|
+
activesupport (= 3.0.7)
|
14
|
+
builder (~> 2.1.2)
|
15
|
+
erubis (~> 2.6.6)
|
16
|
+
i18n (~> 0.5.0)
|
17
|
+
rack (~> 1.2.1)
|
18
|
+
rack-mount (~> 0.6.14)
|
19
|
+
rack-test (~> 0.5.7)
|
20
|
+
tzinfo (~> 0.3.23)
|
21
|
+
activemodel (3.0.7)
|
22
|
+
activesupport (= 3.0.7)
|
23
|
+
builder (~> 2.1.2)
|
24
|
+
i18n (~> 0.5.0)
|
25
|
+
activesupport (3.0.7)
|
26
|
+
builder (2.1.2)
|
27
|
+
erubis (2.6.6)
|
28
|
+
abstract (>= 1.0.0)
|
29
|
+
i18n (0.5.0)
|
30
|
+
rack (1.2.3)
|
31
|
+
rack-mount (0.6.14)
|
32
|
+
rack (>= 1.0.0)
|
33
|
+
rack-test (0.5.7)
|
34
|
+
rack (>= 1.0)
|
35
|
+
tzinfo (0.3.27)
|
36
|
+
|
37
|
+
PLATFORMS
|
38
|
+
ruby
|
39
|
+
|
40
|
+
DEPENDENCIES
|
41
|
+
image_bundle!
|
data/README.md
CHANGED
@@ -1,34 +1,33 @@
|
|
1
|
-
|
1
|
+
# ImageBundle
|
2
2
|
|
3
|
-
ImageBundleHelper adds view helper
|
3
|
+
ImageBundleHelper adds view helper **image_bundle**. A helper which
|
4
4
|
bundles individual local images into a single CSS sprite thereby
|
5
5
|
reducing the number of HTTP requests needed to render the page.
|
6
6
|
|
7
|
-
|
8
|
-
team}[http://developer.yahoo.com/performance/] found that the number
|
7
|
+
[Yahoo's Exceptional Performance team][http://developer.yahoo.com/performance/] found that the number
|
9
8
|
of HTTP requests has the biggest impact on page rendering speed. You
|
10
9
|
can inspect your site's performance with the excellent Firefox add-on
|
11
|
-
|
10
|
+
[YSlow][http://developer.yahoo.com/yslow/].
|
12
11
|
|
13
|
-
|
12
|
+
## Usage
|
14
13
|
|
15
14
|
Use ImageBundle to automatically replace individual local images into
|
16
15
|
CSS sprites.
|
17
16
|
|
18
|
-
|
17
|
+
## Demo
|
19
18
|
|
20
|
-
A demo of ImageBundle is available at http://thecodemill.biz/image_bundle
|
19
|
+
A demo of ImageBundle is available at <http://thecodemill.biz/image_bundle/>.
|
21
20
|
|
22
|
-
|
21
|
+
## Note on `image_tag` helper
|
23
22
|
|
24
|
-
Rails'
|
25
|
-
'bust caches'. It ads either the
|
23
|
+
Rails' `image_tag` helper adds a query parameter to the image URL to
|
24
|
+
'bust caches'. It ads either the `RAILS_ASSET_ID` environment variable
|
26
25
|
or the image's modification time. This is the *wrong* thing to
|
27
26
|
do. Caches should be managed through the use of HTTP headers such as
|
28
27
|
Cache-Control, Last-Modified, Expires and of course the HTTP response
|
29
28
|
code. Adding the modification time is the same as using as using
|
30
29
|
ETags in apache or IIS, see
|
31
|
-
http://developer.yahoo.com/performance/rules.html#etags for an
|
30
|
+
<http://developer.yahoo.com/performance/rules.html#etags> for an
|
32
31
|
explanation why it is better to avoid using ETags in favor of proper
|
33
32
|
Expires headers.
|
34
33
|
|
@@ -36,9 +35,9 @@ This plugin doesn't accept image URLS that include query parameters as
|
|
36
35
|
they are either dynamically generated and shouldn't be part of a
|
37
36
|
sprite or they promote a bad practice.
|
38
37
|
|
39
|
-
If you like to use the
|
38
|
+
If you like to use the `image_tag` helper I recommend you a) configure
|
40
39
|
the webserver of you static content to return proper headers and b) to
|
41
|
-
overwrite
|
40
|
+
overwrite `ActionView::Helpers::AssetTagsHelper#rewrite_asset_path!`
|
42
41
|
like so:
|
43
42
|
|
44
43
|
module ActionView
|
@@ -50,11 +49,11 @@ like so:
|
|
50
49
|
end
|
51
50
|
end
|
52
51
|
|
53
|
-
Create a file
|
54
|
-
|
52
|
+
Create a file `lib/asset_tag_helper.rb` and load it at the end of your
|
53
|
+
`config/environment.rb` file like so:
|
55
54
|
|
56
55
|
require File.join(File.dirname(__FILE__), '../lib/asset_tag_helper')
|
57
56
|
|
58
|
-
|
57
|
+
## License & Author
|
59
58
|
|
60
59
|
:include: LICENSE
|
data/image_bundle.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "https://github.com/bartt/image_bundle"
|
12
12
|
s.summary = %q{ImageBundle bundles individual images into a single sprite and CSS rules to match}
|
13
13
|
s.description = %q{ImageBundle adds a helper to Ruby on Rails to create image sprites and matching CSS rules on the fly. Overhead is minimal as sprites are cached. ImageBundle is rendering framework agnostic.}
|
14
|
+
s.license = "LGPL-2"
|
14
15
|
|
15
16
|
s.rubyforge_project = "image_bundle"
|
16
17
|
s.add_dependency "actionpack", "~> 3.0.7"
|
data/lib/image_bundle/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: image_bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Bart Teeuwisse
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-06 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -34,24 +34,22 @@ extensions: []
|
|
34
34
|
extra_rdoc_files: []
|
35
35
|
|
36
36
|
files:
|
37
|
-
- .bzrignore
|
38
37
|
- .gitignore
|
39
38
|
- Gemfile
|
39
|
+
- Gemfile.lock
|
40
40
|
- LICENSE
|
41
41
|
- README.md
|
42
42
|
- Rakefile
|
43
43
|
- image_bundle.gemspec
|
44
44
|
- images/clear.gif
|
45
|
-
- install.rb
|
46
45
|
- lib/image_bundle.rb
|
47
46
|
- lib/image_bundle/version.rb
|
48
47
|
- lib/tasks/image_bundle_tasks.rake
|
49
48
|
- test/image_bundle_test.rb
|
50
|
-
- uninstall.rb
|
51
49
|
has_rdoc: true
|
52
50
|
homepage: https://github.com/bartt/image_bundle
|
53
|
-
licenses:
|
54
|
-
|
51
|
+
licenses:
|
52
|
+
- LGPL-2
|
55
53
|
post_install_message:
|
56
54
|
rdoc_options: []
|
57
55
|
|
data/.bzrignore
DELETED
data/install.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Install hook code here
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|