-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revisions to provide integrated Rails 3.0 support.
Repertoire Assets now detects when it is running in Rails, and installs the Rack middleware automatically via a Railtie. So now the only config necessary is a single line in production.rb to turn on asset precaching. The rake tasks have been revised to integrate cleanly with Rails, and the gemspec configuration follows Rails standards.
- Loading branch information
Christopher York
committed
Jul 29, 2010
1 parent
8926d46
commit 8bc2d6f
Showing
17 changed files
with
189 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
*~ | ||
pkg | ||
doc | ||
*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
Repertoire Assets | ||
================= | ||
|
||
(1) Make sure your application loads the middleware. e.g. for Merb: | ||
|
||
<app>/config/rack.rb (Mongrel) | ||
<app>/config.ru (Passenger) | ||
(1) Make sure your application loads the middleware. For Rails 3.0, | ||
including repertoire-assets in your Gemfile does this automatically. | ||
|
||
For Merb and others, you will need to alter your rackup file. The | ||
middleware takes two optional arguments: a configuration hash and | ||
the system logger. | ||
|
||
<app>/config/rack.rb (Mongrel) | ||
<app>/config.ru (Passenger) | ||
|
||
* require 'repertoire-assets' | ||
* use Repertoire::Assets::Processor, Merb::Config, Merb.logger | ||
* require 'repertoire-assets' | ||
* use Repertoire::Assets::Processor, Merb::Config, Merb.logger | ||
|
||
run Merb::Rack::Application.new | ||
run Merb::Rack::Application.new | ||
|
||
|
||
(2) Turn on precaching and compression in your production environment, | ||
so gem assets are served by your web server. e.g. for Merb: | ||
so gem assets are served by your web server. e.g. for Rails: | ||
|
||
<app>/config/environments/production.rb: | ||
|
||
* c[:compress_assets] = true | ||
* config.repertoire_assets.compress = true | ||
|
||
Or in Merb: | ||
|
||
<app>/config/environments/production.rb: | ||
|
||
* c[:compress] = true | ||
|
||
For other options that can be used in the configuration hash, see the | ||
documentation for Repertoire::Assets::Processor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,10 @@ | ||
begin | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |s| | ||
s.name = "repertoire-assets" | ||
s.summary = "Repertoire Assets javascript and css distribution framework" | ||
s.description = "Repertoire Assets javascript and css distribution framework" | ||
s.email = "[email protected]" | ||
s.homepage = "http://github.com/repertoire/repertoire-assets" | ||
s.authors = ["Christopher York"] | ||
s.add_dependency('rack', '>=1.0.1') | ||
s.post_install_message = <<-POST_INSTALL_MESSAGE | ||
#{'*'*80} | ||
One of your gems uses Repertoire asset support, which provides access to | ||
javascript, stylesheets and or others assets distributed via Rubygems. | ||
require __FILE__ + '/../lib/repertoire-assets' | ||
|
||
Rack middleware serves assets in front of your Merb or Rails application, | ||
and includes <script> and <link> tags in the header automatically. | ||
gemspec = eval(File.read("repertoire-assets.gemspec")) | ||
|
||
(1) Make sure your application loads the middleware. e.g. for Merb: | ||
task :build => "#{gemspec.full_name}.gem" | ||
|
||
<app>/config/rack.rb (Mongrel) | ||
<app>/config.ru (Passenger) | ||
require 'repertoire-assets' | ||
use Repertoire::Assets::Processor, Merb::Config, Merb.logger | ||
run Merb::Rack::Application.new | ||
(2) Turn on precaching and compression in your production environment, | ||
so gem assets are served by your web server. e.g. for Merb: | ||
<app>/config/environments/production.rb: | ||
c[:compress_assets] = true | ||
See the repertoire-assets README for details. | ||
#{'*'*80} | ||
POST_INSTALL_MESSAGE | ||
end | ||
Jeweler::RubyforgeTasks.new do |rubyforge| | ||
rubyforge.doc_task = "yardoc" | ||
end | ||
|
||
Jeweler::GemcutterTasks.new | ||
rescue LoadError | ||
puts "Jeweler not available. Install it with: sudo gem install jeweler" | ||
file "#{gemspec.full_name}.gem" => gemspec.files + ["repertoire-assets.gemspec"] do | ||
system "gem build repertoire-assets.gemspec" | ||
system "gem install repertoire-assets-#{Repertoire::Assets::VERSION}.gem" | ||
end | ||
|
||
|
||
begin | ||
require 'yard' | ||
YARD::Rake::YardocTask.new(:yardoc) | ||
rescue LoadError | ||
task :yardoc do | ||
abort "YARD is not available. In order to run yard, you must: sudo gem install yard" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.