<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Synthesis: AssetPackager released!</title>
    <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>by Scott Becker</description>
    <item>
      <title>AssetPackager released!</title>
      <description>&lt;p&gt;Asset Packager has been released! (Formerly known as MergeJS) New features include:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;support for css files&lt;/li&gt;
		&lt;li&gt;versioning of individual packages&lt;/li&gt;
		&lt;li&gt;use of more meaningful subversion revision numbers (if available) (thanks Chris Van Pelt!)&lt;/li&gt;
		&lt;li&gt;namespaced rake tasks&lt;/li&gt;
		&lt;li&gt;no more revision numbers in the yaml file&lt;/li&gt;
		&lt;li&gt;lotsa refactoring&lt;/li&gt;
		&lt;li&gt;unit tests&lt;/li&gt;
		&lt;li&gt;more intuitive names for everything!&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Go here to check it out: &lt;a href="http://synthesis.sbecker.net/pages/asset_packager"&gt;AssetPackager&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 19 Jun 2006 09:33:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7e769f6a-71e3-4bcd-b544-b9522afb71b6</guid>
      <author>sbecker</author>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released</link>
      <category>Ruby on Rails</category>
      <category>Web Development</category>
      <category>javascript</category>
      <category>css</category>
      <category>merging</category>
      <category>compression</category>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>"AssetPackager released!" by Klaus Hartl</title>
      <description>&lt;p&gt;@Joel that worked better for me (based on r57):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? &amp;#38;&amp;#38; ext || ext =~ /css|js/ &amp;#38;&amp;#38; File.extname(source).delete('.') != ext

&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 14 May 2008 06:56:11 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:b4b1671f-fe43-47f6-8ac6-e679610f3fe5</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7845</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Klaus Hartl</title>
      <description>&lt;p&gt;@Joel that worked better for me (based on r57):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? &amp;#38;&amp;#38; ext || ext =~ /css|js/ &amp;#38;&amp;#38; File.extname(source).delete('.') != ext

&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 14 May 2008 06:55:07 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:26518d85-8521-436a-baca-0e3736b4ffbd</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7844</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Klaus Hartl</title>
      <description>&lt;p&gt;@Joel that worked better for me (based on r57):&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? &amp;#38;&amp;#38; ext || ext =~ /css|js/ &amp;#38;&amp;#38; File.extname(source).delete('.') != ext

&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 14 May 2008 06:53:36 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:fad8378a-7795-4350-93f1-62a03eec0578</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7843</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Klaus Hartl</title>
      <description>&lt;p&gt;I am getting a &amp;#8220;Service Temporarily Unavailable&amp;#8221; error for the tracker, thus I&amp;#8217;m posting it here:&lt;/p&gt;


	&lt;p&gt;I recently ran into a subtle bug with compressed style sheets. If you have a comment in a property or value without a following white space like this:&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;property: /**/value;&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;the parser will not see the end of this comment and instead strip away everything up until it encounters the next closing comment.&lt;/p&gt;</description>
      <pubDate>Wed, 14 May 2008 02:58:25 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:dab10b81-bfa1-413c-88c0-78143df9c464</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7842</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Joel</title>
      <description>&lt;p&gt;Sorry about the triple(?!) posts.. Didnt see the update =)&lt;/p&gt;</description>
      <pubDate>Sat, 29 Mar 2008 06:21:58 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:a0512bc3-12f3-4e6b-9602-09c2aa7d8820</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7829</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Joel</title>
      <description>&lt;p&gt;Seems like the compute_public_path has some trouble with file names containing periods (common in jquery libs among others).&lt;/p&gt;


	&lt;p&gt;The .js either does not get appended (in development) or if u explicit set it in the asset_packages.yml it gets appended even if it should not.&lt;/p&gt;


	&lt;p&gt;Hackfix:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
  line 41: source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank?
  === changed to:
  source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? || (!ext.nil? &amp;#38;&amp;#38; File.extname(source) != ext)
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Seems to fix it.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Mar 2008 06:21:11 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:29288302-6fbc-4e35-b409-1f96537a6e1b</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7828</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Joel</title>
      <description>&lt;p&gt;Seems like the compute_public_path has some trouble with file names containing periods (common in jquery libs among others).&lt;/p&gt;


	&lt;p&gt;The .js either does not get appended (in development) or if u explicit set it in the asset_packages.yml it gets appended even if it should not.&lt;/p&gt;


	&lt;p&gt;Hackfix:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
  line 41: source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank?
  === changed to:
  source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? || (!ext.nil? &amp;#38;&amp;#38; File.extname(source) != ext)
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Seems to fix it.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Mar 2008 06:21:05 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:34cd049b-dc1c-4ec2-b4ab-4645184b9669</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7827</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Joel</title>
      <description>&lt;p&gt;Seems like the compute_public_path has some trouble with file names containing periods (common in jquery libs among others).&lt;/p&gt;


	&lt;p&gt;The .js either does not get appended (in development) or if u explicit set it in the asset_packages.yml it gets appended even if it should not.&lt;/p&gt;


	&lt;p&gt;Hackfix:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
  line 41: source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank?
  === changed to:
  source &amp;lt;&amp;lt; ".#{ext}" if File.extname(source).blank? || (!ext.nil? &amp;#38;&amp;#38; File.extname(source) != ext)
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Seems to fix it.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Mar 2008 06:20:51 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:d65a3d9e-41a1-4b0c-8efd-c15526206dff</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7826</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Jim</title>
      <description>&lt;p&gt;I see that Synthesis::AssetPackage.build_all has a dependency on the &amp;#8220;get_file_revision&amp;#8221; method which depends on SVN.&lt;/p&gt;


	&lt;p&gt;Has an update been released to make this Git compatible?&lt;/p&gt;</description>
      <pubDate>Tue, 18 Mar 2008 18:44:33 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6b95f19a-32c3-4d98-9852-b03230948aed</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7819</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Jim</title>
      <description>&lt;p&gt;I see that Synthesis::AssetPackage.build_all has a dependency on the &amp;#8220;get_file_revision&amp;#8221; method which depends on SVN.&lt;/p&gt;


	&lt;p&gt;Has an update been released to make this Git compatible?&lt;/p&gt;</description>
      <pubDate>Tue, 18 Mar 2008 18:44:22 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:93ab5995-22b4-4423-a31a-2e5c85154ca7</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7818</link>
    </item>
    <item>
      <title>"AssetPackager released!" by David Vanderson</title>
      <description>&lt;p&gt;Thanks for the great plugin!&lt;/p&gt;


One issue that I ran into was the svn command dying when running under mongrel versions &amp;gt; 1.0.2 that are launched as root but drop their privileges.  You get this error message in the mongrel log:
&lt;pre&gt;
svn: Can't check path '/root/.subversion': Permission denied
&lt;/pre&gt;

	&lt;p&gt;$HOME is still /root, so svn tries to look for /root/.subversion, which throws an exception (due to permissions), which eventually returns a default revision of 1.  In my case I worked around it by adding &amp;#8220;&amp;#8212;config-dir /does-not-exist&amp;#8221; to the svn command.&lt;/p&gt;


	&lt;p&gt;Thanks again,&lt;br&gt;
Dave&lt;/p&gt;</description>
      <pubDate>Fri, 14 Mar 2008 15:11:04 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:1b28a42c-cb06-4c88-beea-8af3324722be</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7815</link>
    </item>
    <item>
      <title>"AssetPackager released!" by David Vanderson</title>
      <description>&lt;p&gt;Thanks for the great plugin!&lt;/p&gt;


One issue that I ran into was the svn command dying when running under mongrel versions &amp;gt; 1.0.2 that are launched as root but drop their privileges.  You get this error message in the mongrel log:
&lt;pre&gt;
svn: Can't check path '/root/.subversion': Permission denied
&lt;/pre&gt;

	&lt;p&gt;$HOME is still /root, so svn tries to look for /root/.subversion, which throws an exception (due to permissions), which eventually returns a default revision of 1.  In my case I worked around it by adding &amp;#8220;&amp;#8212;config-dir /does-not-exist&amp;#8221; to the svn command.&lt;/p&gt;


	&lt;p&gt;Thanks again,&lt;br&gt;
Dave&lt;/p&gt;</description>
      <pubDate>Fri, 14 Mar 2008 15:10:29 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:9437566a-a44f-4f0d-a102-85577d54d886</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7814</link>
    </item>
    <item>
      <title>"AssetPackager released!" by David Vanderson</title>
      <description>&lt;p&gt;Thanks for the great plugin!&lt;/p&gt;


One issue that I ran into was the svn command dying when running under mongrel versions &amp;gt; 1.0.2 that are launched as root but drop their privileges.  You get this error message in the mongrel log:
&lt;pre&gt;
svn: Can't check path '/root/.subversion': Permission denied
&lt;/pre&gt;

	&lt;p&gt;$HOME is still /root, so svn tries to look for /root/.subversion, which throws an exception (due to permissions), which eventually returns a default revision of 1.  In my case I worked around it by adding &amp;#8220;&amp;#8212;config-dir /does-not-exist&amp;#8221; to the svn command.&lt;/p&gt;


	&lt;p&gt;Thanks again,&lt;br&gt;
Dave&lt;/p&gt;</description>
      <pubDate>Fri, 14 Mar 2008 15:10:19 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:47ac728c-9fb5-4b48-acee-7607e942a07a</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7813</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Farsça tercüme</title>
      <description>&lt;p&gt;Your comment contains very useful information about all thank you &lt;a href="http://www.xn--farsatercman-ndb31a.com" rel="nofollow"&gt;fars&amp;ccedil;a terc&amp;uuml;man&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 28 Feb 2008 13:36:01 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:94e6d557-8d0a-4f4a-9c9b-d8ef756acaca</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7806</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Jyrki J. Lilja</title>
      <description>&lt;p&gt;This seems to fix the problem:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
--- a/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb
+++ b/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb
@@ -21,7 +21,10 @@ module Synthesis
         AssetPackage.targets_from_sources("javascripts", sources) : 
         AssetPackage.sources_from_targets("javascripts", sources))

-      sources.collect {|source| javascript_include_tag(source, options) }.join("\n")
+      sources.collect { |source|
+        source = javascript_path(source)
+        content_tag("script", nil, { "type" =&amp;gt; "text/javascript", "src" =&amp;gt; source }.merge(options))
+      }.join("\n")
     end

     def stylesheet_link_merged(*sources)
&lt;/code&gt;
&lt;/pre&gt;</description>
      <pubDate>Wed, 27 Feb 2008 12:51:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:a3fdce37-3074-4189-b44e-8eca73c7ea75</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7805</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Jyrki J. Lilja</title>
      <description>&lt;p&gt;Hello!
Thanks for great plugin =)
I ran into a problem with javascript_include_merged, which, for some odd reason adds the querystring timestamp to src. Is there any solution, because my JS is over 100 kB and is hard for bandwitch because it&amp;#8217;s transferred every time I load the page.&lt;/p&gt;


	&lt;p&gt;Thanks in advance,
Jyrki J.&lt;/p&gt;</description>
      <pubDate>Tue, 26 Feb 2008 05:00:32 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:d82a62b9-eb21-4b9e-bf0a-185c6a34d11c</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7804</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;So sorry about the duplicate posts!  Some weird latency problem caused the interface not to respond, then to my horror there are all these posts that I can&amp;#8217;t delete!&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:03:57 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:7fa0ee44-801b-40ae-9c3c-8390c25906bb</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7802</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;I ran into a problem with adding a single javascript file to the asset_packages.yml file.  Since the svn version number on the new file was older than the previous version, asset_packager didn&amp;#8217;t build a new file, and likewise, browsers wouldn&amp;#8217;t know that the file had changed because the version number didn&amp;#8217;t change.  I think since any change to asset_packages.yml could affect any of the packages, the version number of the asset_packages.yml needs to be included in the calculation.  Here&amp;#8217;s my patch:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/151920" rel="nofollow"&gt;http://pastie.caboo.se/151920&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:03:04 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:b0c4dfc2-a306-4169-ad1f-23b49ce7147e</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7801</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;I ran into a problem with adding a single javascript file to the asset_packages.yml file.  Since the svn version number on the new file was older than the previous version, asset_packager didn&amp;#8217;t build a new file, and likewise, browsers wouldn&amp;#8217;t know that the file had changed because the version number didn&amp;#8217;t change.  I think since any change to asset_packages.yml could affect any of the packages, the version number of the asset_packages.yml needs to be included in the calculation.  Here&amp;#8217;s my patch:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/151920" rel="nofollow"&gt;http://pastie.caboo.se/151920&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:02:33 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:81062295-2273-48a6-9ef6-ba35eb437ac5</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7800</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;I ran into a problem with adding a single javascript file to the asset_packages.yml file.  Since the svn version number on the new file was older than the previous version, asset_packager didn&amp;#8217;t build a new file, and likewise, browsers wouldn&amp;#8217;t know that the file had changed because the version number didn&amp;#8217;t change.  I think since any change to asset_packages.yml could affect any of the packages, the version number of the asset_packages.yml needs to be included in the calculation.  Here&amp;#8217;s my patch:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/151920" rel="nofollow"&gt;http://pastie.caboo.se/151920&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:02:01 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4d942ffd-5be3-4786-bfed-619ede9a0766</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7799</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;I ran into a problem with adding a single javascript file to the asset_packages.yml file.  Since the svn version number on the new file was older than the previous version, asset_packager didn&amp;#8217;t build a new file, and likewise, browsers wouldn&amp;#8217;t know that the file had changed because the version number didn&amp;#8217;t change.  I think since any change to asset_packages.yml could affect any of the packages, the version number of the asset_packages.yml needs to be included in the calculation.  Here&amp;#8217;s my patch:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/151920" rel="nofollow"&gt;http://pastie.caboo.se/151920&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:01:33 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:54c834a4-90eb-44f8-92d8-e6d99da43aa4</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7798</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Alf Mikula</title>
      <description>&lt;p&gt;I ran into a problem with adding a single javascript file to the asset_packages.yml file.  Since the svn version number on the new file was older than the previous version, asset_packager didn&amp;#8217;t build a new file, and likewise, browsers wouldn&amp;#8217;t know that the file had changed because the version number didn&amp;#8217;t change.  I think since any change to asset_packages.yml could affect any of the packages, the version number of the asset_packages.yml needs to be included in the calculation.  Here&amp;#8217;s my patch:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/151920" rel="nofollow"&gt;http://pastie.caboo.se/151920&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 13 Feb 2008 18:01:31 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:769a2264-de96-4cc7-981f-8bafcfd648da</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7797</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Richard</title>
      <description>&lt;p&gt;Fantastic Plugin!&lt;/p&gt;


	&lt;p&gt;Package Version Numbers!&lt;/p&gt;


	&lt;p&gt;We ran into an issue when building the asset packages where we modified the asset_packages.yml and hadn&amp;#8217;t modified any of the js files. This caused an issue where the version of the packaged files didn&amp;#8217;t change thus any browser that had cached the previous version didn&amp;#8217;t get the changes.&lt;/p&gt;


	&lt;p&gt;We therefore have included in the asset_package.rb on revision method:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
      def revision
        unless @revision
          revisions = [1]
          revisions &amp;lt;&amp;lt; get_file_revision("#{@asset_path}/../../config/asset_packages.yml")
          @sources.each do |source|
            revisions &amp;lt;&amp;lt; get_file_revision("#{@asset_path}/#{source}.#{@extension}")
          end
          @revision = revisions.max
        end
        @revision
      end
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;Notice that we now include the asset_packages.yml version in the max lookup.&lt;/p&gt;</description>
      <pubDate>Tue, 12 Feb 2008 17:04:02 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:830845c2-859a-45a6-af06-1c36463d844c</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7794</link>
    </item>
    <item>
      <title>"AssetPackager released!" by Ryan Kuykendall</title>
      <description>&lt;p&gt;Asset packager is a fantastic plugin. Per a comment above (about Dir.entries instead of Dir.new(...).entries, couldn&amp;#8217;t the following code be further simplified from this:&lt;/p&gt;


&lt;pre&gt;
    def current_file                                                                                                                                                                             
      @target_dir.gsub(/^(.+)$/, '\1/') +                                                                                                                                                        
        Dir.new(@asset_path).entries.delete_if { |x| ! (x =~ @match_regex) }.sort.reverse[0].chomp(".#{@extension}")                                                                                 
    end
&lt;/pre&gt;

	&lt;p&gt;To this (grab the last item instead of reversing the list to grab the [0] element&amp;#8230;also do x !~ regex rather than ! ( x =~ regex)):&lt;/p&gt;


&lt;pre&gt;
    def current_file                                                                                                                                                                             
      @target_dir.gsub(/^(.+)$/, '\1/') +                                                                                                                                                        
        Dir.new(@asset_path).entries.delete_if { |x| x !~ @match_regex}.sort.last.chomp(".#{@extension}")                                                                                 
    end
&lt;/pre&gt;

	&lt;p&gt;Also, if I am reading the code correctly, with every page serve, the stylesheets or javascripts directory are being read for the most recent version of the file listed in the yaml file.  Wouldn&amp;#8217;t it be better, once the filename/path has been determined, to cache it in a class variable (since files are not being dynamically added to the assets directories?)  Maybe like this:&lt;/p&gt;


&lt;pre&gt;
    @@cached_asset_file_paths = {:css =&amp;gt; {}, :js =&amp;gt; {}}

    def current_file
      unless @@cached_asset_file_paths[@extension.to_sym].has_key?([@target.to_sym])
          @@cached_asset_file_paths[@extension.to_sym][@target.to_sym] = @target_dir.gsub(/^(.+)$/, '\1/') +                                                                                                                                                        
            Dir.new(@asset_path).entries.delete_if { |x| x !~ @match_regex}.sort.last.chomp(".#{@extension}")
      end

      @@cached_asset_file_paths[@extension.to_sym][@target.to_sym]                                                                                 
    end
&lt;/pre&gt;

	&lt;p&gt;Thanks again for a great plugin. Definitely makes my site feel snappier.&lt;/p&gt;</description>
      <pubDate>Thu, 07 Feb 2008 16:41:53 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:ff7825fa-5d4d-4774-9025-a6bc5ebb3ad6</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7779</link>
    </item>
    <item>
      <title>"AssetPackager released!" by bloggingdeveloper</title>
      <description>&lt;p&gt;Another free online tool for compressing javascript is &lt;a href="http://www.compressjavascript.com" rel="nofollow"&gt;http://www.compressjavascript.com&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;cheers,
blogging developer
&lt;a href="http://www.bloggingdeveloper.com" rel="nofollow"&gt;http://www.bloggingdeveloper.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 29 Jan 2008 09:40:14 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:2ba9539e-bd5c-4e3b-af54-6e0ef4db9b81</guid>
      <link>http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comment-7774</link>
    </item>
  </channel>
</rss>
