diff --git a/tracks/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb b/tracks/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb index 8c49fa78..76a15903 100644 --- a/tracks/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb +++ b/tracks/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb @@ -1,6 +1,6 @@ module Synthesis module AssetPackageHelper - + def javascript_include_merged(*sources) options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { } @@ -13,10 +13,11 @@ module Synthesis end sources.collect!{|s| s.to_s} - sources = (RAILS_ENV != "development" || SUPPRESS_ASSET_PACKAGER ? - AssetPackage.targets_from_sources("javascripts", sources) : - AssetPackage.sources_from_targets("javascripts", sources)) - + sources = if suppress_packaging? + AssetPackage.sources_from_targets("javascripts", sources) + else + AssetPackage.targets_from_sources("javascripts", sources) + end sources.collect {|source| javascript_include_tag(source, options) }.join("\n") end @@ -24,9 +25,11 @@ module Synthesis options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { } sources.collect!{|s| s.to_s} - sources = (RAILS_ENV != "development" || SUPPRESS_ASSET_PACKAGER ? - AssetPackage.targets_from_sources("stylesheets", sources) : - AssetPackage.sources_from_targets("stylesheets", sources)) + sources = if suppress_packaging? + AssetPackage.sources_from_targets("stylesheets", sources) + else + AssetPackage.targets_from_sources("stylesheets", sources) + end sources.collect { |source| source = stylesheet_path(source) @@ -35,6 +38,13 @@ module Synthesis end private + + def suppress_packaging? + return true if RAILS_ENV == "development" + return true if SUPPRESS_ASSET_PACKAGER == true rescue nil + return false + end + # rewrite compute_public_path to allow us to not include the query string timestamp # used by ActionView::Helpers::AssetTagHelper def compute_public_path(source, dir, ext, add_asset_id=true)