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 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
- or in Rails:
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.middleware.use Rack::Sprocketize
22
+ config.sprocketize.always_compress = true
21
23
 
22
24
  ### Sprocketizing
23
25
 
@@ -89,3 +89,5 @@ module Rack
89
89
  end
90
90
  end
91
91
  end
92
+
93
+ require 'rack/sprocketize/railtie' if defined?(Rails)
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Sprocketize
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  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: 23
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 0.2.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-15 00:00:00 -05:00
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