Report abuse


			
Index: lib/synthesis/asset_package_helper.rb
===================================================================
--- lib/synthesis/asset_package_helper.rb       (revision 43)
+++ lib/synthesis/asset_package_helper.rb       (working copy)
@@ -13,7 +13,7 @@
       end

       sources.collect!{|s| s.to_s}
-      sources = (RAILS_ENV == "production" ? 
+      sources = (AssetPackage.merge ? 
         AssetPackage.targets_from_sources("javascripts", sources) : 
         AssetPackage.sources_from_targets("javascripts", sources))

@@ -24,7 +24,7 @@
       options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }

       sources.collect!{|s| s.to_s}
-      sources = (RAILS_ENV == "production" ? 
+      sources = (AssetPackage.merge ? 
         AssetPackage.targets_from_sources("stylesheets", sources) : 
         AssetPackage.sources_from_targets("stylesheets", sources))

Index: lib/synthesis/asset_package.rb
===================================================================
--- lib/synthesis/asset_package.rb      (revision 43)
+++ lib/synthesis/asset_package.rb      (working copy)
@@ -1,6 +1,14 @@
 module Synthesis
   class AssetPackage
     # class variables
+    
+    # CHANGED : Added based on comment by 'yoav' found on : http://synthesis.sbecker.net/articles/2006/06/19/assetpackager-released#comments
+    # This change still forces merge only on production environment by default.
+    # Class accessor allows override of this value in environment.rb with something like this to force in the environments listed:
+    # 'Synthesis::AssetPackage.merge = (RAILS_ENV == "development" || RAILS_ENV == "staging" || RAILS_ENV == "production")'
+    @@options = { :merge => (RAILS_ENV == "production") }
+    cattr_accessor :merge
+    
     @@asset_packages_yml = $asset_packages_yml || 
       (File.exists?("#{RAILS_ROOT}/config/asset_packages.yml") ? YAML.load_file("#{RAILS_ROOT}/config/asset_packages.yml") : nil)