lib/roda/plugins/assets.rb in roda-2.11.0 vs lib/roda/plugins/assets.rb in roda-2.12.0
- old
+ new
@@ -7,17 +7,20 @@
# asset files on the fly in development, and compiling them
# to a single, compressed file in production.
#
# This uses the render plugin for rendering the assets, and the render
# plugin uses tilt internally, so you can use any template engine
- # supported by tilt for you assets. Tilt ships with support for
+ # supported by tilt for your assets. Tilt ships with support for
# the following asset template engines, assuming the necessary libaries
# are installed:
#
# css :: Less, Sass, Scss
# js :: CoffeeScript
#
+ # You can also use opal as a javascript template engine, assuming it is
+ # installed.
+ #
# == Usage
#
# When loading the plugin, use the :css and :js options
# to set the source file(s) to use for CSS and javascript assets:
#
@@ -26,16 +29,17 @@
# This will look for the following files:
#
# assets/css/some_file.scss
# assets/js/some_file.coffee
#
- # If you want to change the paths where asset files are stored, see the
+ # The values for the :css and :js options can be arrays to load multiple
+ # files. If you want to change the paths where asset files are stored, see the
# Options section below.
#
# === Serving
#
- # In your routes, call the r.assets method to add a route to your assets,
+ # In your routes, call the +r.assets+ method to add a route to your assets,
# which will make your app serve the rendered assets:
#
# route do |r|
# r.assets
# end
@@ -124,13 +128,16 @@
# so that they can be served by the webserver.
#
# === Asset Compression
#
# If you have the yuicompressor gem installed and working, it will be used
- # automatically to compress your javascript and css assets. Otherwise,
- # the assets will just be concatenated together and not compressed during
- # compilation.
+ # automatically to compress your javascript and css assets. For javascript
+ # assets, if yuicompressor is not available, the plugin will check for
+ # closure_compiler, uglifier, and minjs and use the first one that works.
+ # If no compressors are available, the assets will just be concatenated
+ # together and not compressed during compilation. You can use the
+ # :css_compressor and :js_compressor options to specify the compressor to use.
#
# === With Asset Groups
#
# When using asset groups, a separate compiled file will be produced per
# asset group.
@@ -141,11 +148,11 @@
# a SHA1 hash of the content of the file. This is done so that clients do
# not attempt to use cached versions of the assets if the asset has changed.
#
# === Serving
#
- # If you call +r.assets+ when compiling assets, will serve the compiled asset
+ # When compiling assets, +r.assets+ will serve the compiled asset
# files. However, it is recommended to have the main webserver (e.g. nginx)
# serve the compiled files, instead of relying on the application.
#
# Assuming you are using compiled assets in production mode that are served
# by the webserver, you can remove the serving of them by the application:
@@ -163,10 +170,10 @@
# If you want to precompile your assets, so they do not need to be compiled
# every time you boot the application, you can provide a :precompiled option
# when loading the plugin. The value of this option should be the filename
# where the compiled asset metadata is stored.
#
- # If the compiled assset metadata file does not exist when the assets plugin
+ # If the compiled asset metadata file does not exist when the assets plugin
# is loaded, the plugin will run in non-compiled mode. However, when you call
# compile_assets, it will write the compiled asset metadata file after
# compiling the assets.
#
# If the compiled asset metadata file already exists when the assets plugin