Skip to content

Commit

Permalink
Fixed overzealous warning when using local vendor URL fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
rondevera committed Apr 22, 2011
1 parent 3a99a22 commit b10f736
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/asset_hat/js/vendors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b10f736

Please sign in to comment.