rack-sprocketize 0.2.0 → 0.3.0
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/README.md +5 -3
- data/lib/rack/sprocketize.rb +2 -0
- data/lib/rack/sprocketize/railtie.rb +14 -0
- data/lib/rack/sprocketize/version.rb +1 -1
- metadata +5 -4
data/README.md
CHANGED
@@ -8,16 +8,18 @@ Rack::Sprocketize is a piece of Rack Middleware which uses [Sprockets](http://ge
|
|
8
8
|
|
9
9
|
## Basic Usage
|
10
10
|
|
11
|
+
In a Rack based app, use Rack::Sprocketize just like any other middleware, passing options if necessary.
|
12
|
+
|
11
13
|
require 'rack-sprocketize'
|
12
|
-
use Rack::Sprocketize
|
14
|
+
use Rack::Sprocketize, :always_compress => true
|
13
15
|
|
14
|
-
|
16
|
+
In a Rails 3 app, Rack::Sprocketize is automatically included in the middleware stack, so all you need to worry about is configuration.
|
15
17
|
|
16
18
|
# Gemfile
|
17
19
|
gem 'rack-sprocketize'
|
18
20
|
|
19
21
|
# config/application.rb
|
20
|
-
config.
|
22
|
+
config.sprocketize.always_compress = true
|
21
23
|
|
22
24
|
### Sprocketizing
|
23
25
|
|
data/lib/rack/sprocketize.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rack-sprocketize'
|
2
|
+
require 'rails'
|
3
|
+
|
4
|
+
module Rack
|
5
|
+
class Sprocketize
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
config.sprocketize = ActiveSupport::OrderedOptions.new
|
8
|
+
|
9
|
+
initializer 'rack-sprocketize.initialize' do |app|
|
10
|
+
app.middleware.use Rack::Sprocketize, app.config.sprocketize
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-sprocketize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pete
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-03-
|
19
|
+
date: 2011-03-16 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- Rakefile
|
165
165
|
- lib/rack-sprocketize.rb
|
166
166
|
- lib/rack/sprocketize.rb
|
167
|
+
- lib/rack/sprocketize/railtie.rb
|
167
168
|
- lib/rack/sprocketize/sprocket.rb
|
168
169
|
- lib/rack/sprocketize/version.rb
|
169
170
|
- rack-sprocketize.gemspec
|