<?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: Asset Packager is in a book!</title>
    <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>by Scott Becker</description>
    <item>
      <title>Asset Packager is in a book!</title>
      <description>&lt;p&gt;My plugin &lt;a href="http://synthesis.sbecker.net/pages/asset_packager"&gt;AssetPackager&lt;/a&gt; has been featured in &lt;a href="http://scottraymond.net/"&gt;Scott Raymond&amp;#8217;s&lt;/a&gt; new book &lt;a href="http://www.oreilly.com/catalog/9780596527440/"&gt;Ajax on Rails&lt;/a&gt; !&lt;/p&gt;


	&lt;p&gt;Thanks Scott! Everyone go buy a copy. AssetPackager has a full section in Chapter 9 &amp;#8211; Performance. Nice.&lt;/p&gt;</description>
      <pubDate>Sat, 23 Dec 2006 00:04:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:4a0a6c84-0012-453d-bac4-0c013c9eac49</guid>
      <author>sbecker</author>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book</link>
      <category>Ruby on Rails</category>
      <category>Web Development</category>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by Brett</title>
      <description>&lt;p&gt;Scott, you&amp;#8217;re right of course &amp;#8211; no need for me to modify the plugin.  Just thought it would DRY it up by having it in the plugin.  Although it expects a flattened array, forcing a flatten makes it a little more flexible.&lt;/p&gt;


	&lt;p&gt;Thanks for a great plugin.  It &lt;strong&gt;really&lt;/strong&gt; helps on SSL sites, where assets are not cached.&lt;/p&gt;</description>
      <pubDate>Sat, 27 Jan 2007 18:55:20 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:b7f019ca-2404-4966-b496-4f223f0996a9</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6991</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by Scott Becker</title>
      <description>&lt;p&gt;Brett &amp;#8211; Instead of modifying the plugin itself, why not do:&lt;/p&gt;


&lt;pre&gt;
@javascripts.flatten!
&lt;/pre&gt;

	&lt;p&gt;in your controller? Asset Packager expects a flattened array of sources already. :)&lt;/p&gt;</description>
      <pubDate>Wed, 24 Jan 2007 08:59:55 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:f1e1ee7b-8168-4283-8d32-925ecbb4ca88</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6986</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by Brett</title>
      <description>&lt;p&gt;That&amp;#8217;s&lt;/p&gt;


&lt;pre&gt;
sources.flatten!
&lt;/pre&gt;</description>
      <pubDate>Tue, 23 Jan 2007 22:54:48 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:93324a9a-b5d1-4296-9199-76838f5f6195</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6985</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by Brett</title>
      <description>As I optimize my site further, I want to conditionally include certain javascripts/stylesheets on different pages.  What I want is a 
&lt;pre&gt;
&amp;lt;%= javascript_include_merged @javascripts %&amp;gt;
&lt;/pre&gt;

	&lt;p&gt;once in my header partial.  Then in any page, I can add the javascripts I need.&lt;/p&gt;


	&lt;p&gt;But I needed to add a line to the beginning of &lt;code&gt;javascript_include_merged&lt;/code&gt; and &lt;code&gt;stylesheet_link_merged&lt;/code&gt; in &lt;code&gt;asset_packager_helper.rb&lt;/code&gt;:&lt;/p&gt;


&lt;pre&gt;
@sources.flatten!@
&lt;/pre&gt;
It works for me.</description>
      <pubDate>Tue, 23 Jan 2007 22:14:58 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:3782a93a-868c-489d-bdbd-8632c52908ca</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6984</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by michael@schuerig.de</title>
      <description>&lt;p&gt;Sigh, I trust you&amp;#8217;ll be able to figure out what the source code ought to be.&lt;/p&gt;</description>
      <pubDate>Wed, 27 Dec 2006 16:05:46 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:b6602c43-3c64-4d17-acad-878d4fc85ae9</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6973</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by michael@schuerig.de</title>
      <description>Asset Packager doesn&amp;#8217;t behave as expected when :default JavaScript includes are redefined. This can be corrected with a small change.
	&lt;ol&gt;
	&lt;li&gt;         [&amp;#8216;prototype&amp;#8217;, &amp;#8216;effects&amp;#8217;, &amp;#8216;dragdrop&amp;#8217;, &amp;#8216;controls&amp;#8217;] +
          ActionView::Helpers::AssetTagHelper.send(:class_variable_get, &amp;#8217;@@javascript_default_sources&amp;#8217;) + 
          (File.exists?(&amp;#8221;#{RAILS_ROOT}/public/javascripts/application.js&amp;#8221;) ? [&amp;#8216;application&amp;#8217;] : []) + 
          sources[(sources.index(:defaults) + 1)..sources.length]
        sources.delete(:defaults)
      end&lt;/li&gt;
	&lt;/ol&gt;
	&lt;pre&gt;&lt;code&gt;sources.collect!{|s| s.to_s}
  sources = (RAILS_ENV == "production" ? 
    AssetPackage.targets_from_sources("javascripts", sources) : 
    AssetPackage.sources_from_targets("javascripts", sources))
end&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;sources.collect {|source| javascript_include_tag(source, options) }.join("\n")&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 27 Dec 2006 16:03:46 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:a03ae28a-a727-4bca-a7bd-17ae8530b560</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6972</link>
    </item>
    <item>
      <title>"Asset Packager is in a book!" by michael@schuerig.de</title>
      <description>Asset Packager doesn&amp;#8217;t behave as expected when :default JavaScript includes are redefined. This can be corrected with a small change.
	&lt;ol&gt;
	&lt;li&gt;         [&amp;#8216;prototype&amp;#8217;, &amp;#8216;effects&amp;#8217;, &amp;#8216;dragdrop&amp;#8217;, &amp;#8216;controls&amp;#8217;] +
          ActionView::Helpers::AssetTagHelper.send(:class_variable_get, &amp;#8217;@@javascript_default_sources&amp;#8217;) + 
          (File.exists?(&amp;#8221;#{RAILS_ROOT}/public/javascripts/application.js&amp;#8221;) ? [&amp;#8216;application&amp;#8217;] : []) + 
          sources[(sources.index(:defaults) + 1)..sources.length]
        sources.delete(:defaults)
      end&lt;/li&gt;
	&lt;/ol&gt;
	&lt;pre&gt;&lt;code&gt;sources.collect!{|s| s.to_s}
  sources = (RAILS_ENV == "production" ? 
    AssetPackage.targets_from_sources("javascripts", sources) : 
    AssetPackage.sources_from_targets("javascripts", sources))
end&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;sources.collect {|source| javascript_include_tag(source, options) }.join("\n")&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 27 Dec 2006 16:03:44 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:092978d8-ae97-4287-bd73-0e60fdca37f5</guid>
      <link>http://synthesis.sbecker.net/articles/2006/12/23/asset-packager-is-in-a-book#comment-6971</link>
    </item>
  </channel>
</rss>
