Permalink
Browse files

Fixed overzealous warning when using local vendor URL fallback

  • Loading branch information...
1 parent 3a99a22 commit b10f7364cc618f7a69485fa8a521cc4e7e36a8de @rondevera rondevera committed Apr 22, 2011
Showing with 10 additions and 8 deletions.
  1. +10 −8 lib/asset_hat/js/vendors.rb
@@ -102,14 +102,16 @@ def self.source_for(vendor, options={})
# warning below) in the logs. This needs to be fixed in the app,
# rather than relying on a CDN to provide the latest stable vendor
# version.
- src ||= local_src
- Rails.logger.warn "\n\nAssetHat WARNING (#{Time.now}):\n" + %{
- Tried to reference the vendor JS `:#{vendor}`, but
- #{AssetHat.assets_dir(:js)}/#{local_src} couldn't be found, and
- no vendor version was given in
- #{AssetHat::RELATIVE_CONFIG_FILEPATH}.
- }.squish!
- # TODO: Create `AssetHat::Logger.warn`, etc. methods
+ if src.blank?
+ src = local_src
+ Rails.logger.warn "\n\nAssetHat WARNING (#{Time.now}):\n" + %{
+ Tried to reference the vendor JS `:#{vendor}`, but
+ #{AssetHat.assets_dir(:js)}/#{local_src} couldn't be found, and
+ no vendor version was given in
+ #{AssetHat::RELATIVE_CONFIG_FILEPATH}.
+ }.squish!
+ # TODO: Create `AssetHat::Logger.warn`, etc. methods
+ end
end
src

0 comments on commit b10f736

Please sign in to comment.