Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updates for reqs, adding podweaver and a README

  • Loading branch information...
commit 58c013fd56b17d47d4ec322ace8805c8b18bb40b 1 parent 928bba3
@jshirley authored
Showing with 99 additions and 3 deletions.
  1. +72 −0 README.mkdn
  2. +4 −3 dist.ini
  3. +23 −0 weaver.ini
View
72 README.mkdn
@@ -0,0 +1,72 @@
+# NAME
+
+Plack::Middleware::ComboLoader - Handle combination loading and processing of on-disk resources.
+
+# VERSION
+
+version 0.01
+
+# SYNOPSIS
+
+ use Plack::Builder;
+
+ builder {
+ enable "ComboLoader",
+ roots => {
+ 'yui3' => 'yui3/',
+ 'yui3-gallery' => 'yui3-gallery/',
+ 'our-gallery' => 'our-gallery/',
+ # Or, if you want to run each file through something:
+ '/static/css' => {
+ path => 'static/css',
+ processor => sub {
+ # $_ isa Path::Class::File object
+ JavasSript::Minify::minify( input => $_->slurp );
+ # This method returns a *string*
+ }
+ }
+ },
+ # Optional parameter to save generated files to this path:
+ # If the file is there and it's not too old, it gets served.
+ # If it is too old (the expires below), it will be regenerated
+ save => 'static/combined',
+ expires => 86400, # Keep files around for a day.
+ $app;
+ };
+
+# DESCRIPTION
+
+This is (another) combination loader for static resources. This is designed to
+operate with the YUI3 Loader Service.
+
+You can specify multiple points, and if all files are of the same type it sets
+the mime-type and all proper caching headers for the browser.
+
+The incoming requests will look like:
+
+ http://my.cdn.com/rootName?3.4.1/build/module/module.js&3.4.1/build/module2/module2.js
+
+The rootName specifies the path on disk, and each query arg is a file under the
+path.
+
+# PROCESSING FILES
+
+I highly recommend doing minifying and building prior to any serving. This way
+files stay on disk, unmodified and perform better. If, however, you want to
+do any processing (like compiling templates into JavaScript, a la Handlebars)
+you can do that.
+
+Use the `processor` option, you can munge your files however you wish.
+
+It passes in a
+
+# AUTHOR
+
+J. Shirley <j@shirley.im>
+
+# COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2011 by Infinity Interactive, Inc.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
View
7 dist.ini
@@ -6,6 +6,7 @@ copyright_holder= Infinity Interactive, Inc
[@GPHAT]
[Prereqs]
-Plack = 0
-DateTime = 0
-DateTime::Format::HTTP = 0
+Plack = 0
+HTTP::Date = 0
+MIME::Types = 0
+HTTP::Throwable = 0
View
23 weaver.ini
@@ -0,0 +1,23 @@
+[@CorePrep]
+
+[Name]
+[Version]
+
+[Generic / SYNOPSIS]
+[Generic / DESCRIPTION]
+[Generic / OVERVIEW]
+
+[Region / prelude]
+
+[Leftovers]
+
+[Collect / ATTRIBUTES]
+command = attr
+
+[Collect / METHODS]
+command = method
+
+[Region / postlude]
+
+[Authors]
+[Legal]
Please sign in to comment.
Something went wrong with that request. Please try again.