<?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: New version of AssetPackager</title>
    <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>by Scott Becker</description>
    <item>
      <title>New version of AssetPackager</title>
      <description>&lt;p&gt;Thanks to Dan Kubb for alerting me to a new version of JSMin, the library used by AssetPackager to compress javascript.&lt;/p&gt;


	&lt;p&gt;With the release of the latest jQuery 1.1.1, it triggered a bug in how jsmin was treating characters within a regexp.&lt;/p&gt;


	&lt;p&gt;AssetPackager now has the latest version.&lt;/p&gt;


	&lt;p&gt;Also, for those using Prototype, the v1.5 release that comes with Rails 1.2.1 has a missing semi-colon on line 846. This of course breaks when compressed. To fix it, this line should have a semi-colon at the end. This:&lt;/p&gt;


&lt;pre&gt;
if (params &amp;#38;&amp;#38; /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&amp;#38;_='
&lt;/pre&gt;

	&lt;p&gt;Should be:&lt;/p&gt;


&lt;pre&gt;
if (params &amp;#38;&amp;#38; /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&amp;#38;_=';
&lt;/pre&gt;

	&lt;p&gt;Update: Michael Schuerig has &lt;a href="http://dev.rubyonrails.org/ticket/7301"&gt;posted this to the rails trac&lt;/a&gt; so hopefully this will be fixed soon. In the meantime, it&amp;#8217;s pretty simple to make the change yourself.&lt;/p&gt;</description>
      <pubDate>Thu, 25 Jan 2007 12:55:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:149f3a3c-7609-4b20-8821-32f734e3073c</guid>
      <author>sbecker</author>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager</link>
      <category>Ruby on Rails</category>
      <category>Web Development</category>
    </item>
    <item>
      <title>"New version of AssetPackager" by Anton</title>
      <description>&lt;p&gt;I just realized that it is not necessary to mixin AssetTagHelper to recreate the problem.  Calling image_tag breaks as because your method hides the one overriden by DistributedAssets. DistributedAssets implementation uses alias_method in order to avoid breakage such as this.  Also, the method is mixed into the ActionView::Helpers::AssetTagHelper module, which automatically makes it available to all places that might directly include it without inheriting from ActionView::Base.&lt;/p&gt;


	&lt;p&gt;HTH&lt;/p&gt;</description>
      <pubDate>Tue, 04 Sep 2007 22:25:20 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:4d665a1b-48cf-42e6-9385-b8413c4f2faa</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7560</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Anton</title>
      <description>&lt;p&gt;damn, sorry about the double post, didnt look like it was working :)&lt;/p&gt;</description>
      <pubDate>Tue, 04 Sep 2007 21:23:45 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:ff9c2a41-2af9-45fd-93c7-b3ebf65b1b06</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7559</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Anton</title>
      <description>&lt;p&gt;Hi, thanks for a great plugin!
However, I discovered that the current implementation breaks other plugins.&lt;/p&gt;


	&lt;p&gt;Currently,  your version overrides compute_public_path() and adds a paramter which is used by methods such as image_path(). 
Since you mixin your changes into ActionView::Base, this does not affect helpers until one tries to use AssetTagHelper in custom helpers; in such cases, incorrect versions of the method can become visible.&lt;/p&gt;


	&lt;p&gt;This means that any other plugin that extends behavior of compute_public_path will not be able to function correctly. An example is DistributedAssets plugin.
I have made a patch which fixes this issues and removes the duplication of the rails core code, which will make your plugin more compatible with next versions of rails.  Your changes dont really require changing the core version because you are taking advantage of it only in methods that are also in your module.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/94073" rel="nofollow"&gt;http://pastie.caboo.se/94073&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;HTH,
Anton&lt;/p&gt;</description>
      <pubDate>Tue, 04 Sep 2007 21:23:04 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:48882a9d-4e29-47eb-bfc4-937850d22e48</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7558</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Anton</title>
      <description>&lt;p&gt;Hi, thanks for a great plugin!
However, I discovered that the current implementation breaks other plugins.&lt;/p&gt;


	&lt;p&gt;Currently,  your version overrides compute_public_path() and adds a paramter which is used by methods such as image_path(). 
Since you mixin your changes into ActionView::Base, this does not affect helpers until one tries to use AssetTagHelper in custom helpers; in such cases, incorrect versions of the method can become visible.&lt;/p&gt;


	&lt;p&gt;This means that any other plugin that extends behavior of compute_public_path will not be able to function correctly. An example is DistributedAssets plugin.
I have made a patch which fixes this issues and removes the duplication of the rails core code, which will make your plugin more compatible with next versions of rails.  Your changes dont really require changing the core version because you are taking advantage of it only in methods that are also in your module.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://pastie.caboo.se/94073" rel="nofollow"&gt;http://pastie.caboo.se/94073&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;HTH,
Anton&lt;/p&gt;</description>
      <pubDate>Tue, 04 Sep 2007 21:22:55 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:9f4361b1-381e-47b9-bd5b-128840cdb6fc</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7557</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Mark</title>
      <description>&lt;p&gt;Anyone use AssetPackager with SASS of HAML/SASS fame?  With SASS, the CSS files are generated from the first load. But AssetPackager  is expecting CSS prior to first load. Wonder if it&amp;#8217;s possible to get these two technologies to play together.&lt;/p&gt;</description>
      <pubDate>Fri, 03 Aug 2007 06:54:36 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:011182b9-856a-4360-af5a-ecd9fb76221c</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7512</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Scott</title>
      <description>&lt;p&gt;Ok, latest version fixes the issues I mentioned above with having to run &amp;#8220;asset_packager_test.rb&amp;#8221; twice for it to pass and having to run them in a specific order. But you still need to run them separately.&lt;/p&gt;


	&lt;p&gt;You cant run them all at once (unfortunately) by running &amp;#8220;rake&amp;#8221; because the tests depend on ENV[&amp;#8216;RAILS_ENV&amp;#8217;] being different, and as far as I know, this can&amp;#8217;t be changed in a running script once it is set.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve updated the README with a section on running the tests.&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 12:32:33 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:c74dca10-3d6f-44e6-bfc3-5aafb8c59f3c</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7469</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Scott</title>
      <description>&lt;p&gt;Dharana,&lt;/p&gt;


	&lt;p&gt;If you follow this procedure, all tests will pass:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;rails newtestapp
cd newtestapp
./script/plugin install &lt;a href="http://sbecker.net/shared/plugins/asset_packager"&gt;http://sbecker.net/shared/plugins/asset_packager&lt;/a&gt;
cd vendor/plugins/asset_packager/test/
ruby asset_packager_test.rb # run this twice, will give 1 error the first time, not an error
ruby asset_packager_test.rb # the second time, all pass
ruby asset_package_helper_development_test.rb # all pass
ruby asset_package_helper_production_test.rb # all pass&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The first test class, &amp;#8220;asset_packager_test.rb&amp;#8221; builds all the packages that the next two test classes depend on.&lt;/p&gt;


	&lt;p&gt;The last two have to be run seperately because they have different RAILS_ENV  constant values, which, to my knowledge, can&amp;#8217;t be changed once set.&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 11:47:35 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6a061288-edb5-45c9-adf1-93b9777a1c13</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7468</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Scott</title>
      <description>&lt;p&gt;@dharana &amp;#8211; The tests are written in a way that one set requires RAILS_ENV set to &amp;#8220;development&amp;#8221; and the other requires it set to &amp;#8220;production&amp;#8221; &amp;#8211; as far as I know there is no way to get them to all run together, so if you tried to do that, there would be errors. But I am curious &amp;#8211; I filled out the contact form on your site, so you can send me the report. :) Thanks, &amp;#8211; Scott&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jul 2007 09:02:22 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:07fe33c0-8fd8-4b2c-9c11-e27c5f68d1b6</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7467</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by dharana</title>
      <description>&lt;p&gt;Hello Scott,&lt;/p&gt;


	&lt;p&gt;I just installed asset_packager and there are like 13 tests failing. I was going to send you an attachment with the exacts failing tests but I couldn&amp;#8217;t find a contact form or email on your blog.&lt;/p&gt;</description>
      <pubDate>Sun, 01 Jul 2007 06:11:42 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:687dc3b6-f150-4300-9ec4-0ed789a1c0d3</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7465</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by weepy</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve patched your asset manager to Shrink Safe and Pack (Dean Edwards) the javascript for smaller javascript. Seems to work well =) Don&amp;#8217;t know if ure interested in this ?&lt;/p&gt;


	&lt;p&gt;weepy&lt;/p&gt;</description>
      <pubDate>Thu, 03 May 2007 01:26:05 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7d872d3f-2007-46b8-8595-70f17a6d490b</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7042</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by weepy</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve patched your asset manager to Shrink Safe and Pack (Dean Edwards) the javascript for smaller javascript. Seems to work well =) Don&amp;#8217;t know if ure interested in this ?&lt;/p&gt;


	&lt;p&gt;weepy&lt;/p&gt;</description>
      <pubDate>Thu, 03 May 2007 01:26:01 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:1ae99cbb-00ff-4695-a183-cce3d52f4134</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7041</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Lars S. Geisler</title>
      <description>&lt;p&gt;Sadly, the patch Michael Schuerig submitted to trac has been WONTFIX&amp;#8217;ed:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;we will add this semicolon somewhere in the future for consistency with the rest of the code, but we will not write code towards &amp;#8220;compatibility&amp;#8221; with various packers&lt;/p&gt;
	&lt;/blockquote&gt;</description>
      <pubDate>Wed, 02 May 2007 04:57:02 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:a17f34b8-1007-4277-b0fb-8b74a5cf64e6</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7040</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Tom Beddard</title>
      <description>&lt;p&gt;Oops, sorry about the double post above!&lt;/p&gt;


	&lt;p&gt;I also just found another issue, files with more than one dot aren&amp;#8217;t correctly linked when running in development mode, e.g. jquery.autocomplete.js is linked as &amp;#8221;/stylesheets/jquery.autocomplete&amp;#8221;&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 14:02:02 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:9be31a18-9bbb-42b6-aafa-47ce28f6fce9</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7002</link>
    </item>
    <item>
      <title>"New version of AssetPackager" by Tom Beddard</title>
      <description>&lt;p&gt;I have just been trying out your plugin and it looks great, however there is an issue when storing the compressed asset in a sub-folder   of the main assets directory.&lt;/p&gt;


	&lt;p&gt;For my application I have an admin sub-directory where I store all the admin stylesheets. Your plugin will create the compressed CSS file within the admin/ folder if I define the asset_packages.yml like:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;stylesheets:
- admin/admin:
  - admin/layout
  - admin/navigation
  - admin/documents&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;But then when I use: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;&amp;lt;%= stylesheet_link_merged "admin/admin" %&amp;gt;&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;I get the error: &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;private method `chomp' called for nil:NilClass on line 83 of asset_package.rb&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Unfortunately I need to keep the compressed admin CSS file within the sub-folder as it contains relative paths to images. Any suggestions for a fix?&lt;/p&gt;</description>
      <pubDate>Thu, 15 Feb 2007 13:46:09 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:7ebe26ce-a773-4fd3-a266-641daa23b966</guid>
      <link>http://synthesis.sbecker.net/articles/2007/01/25/new-version-of-assetpackager#comment-7000</link>
    </item>
  </channel>
</rss>
