Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Commit

Permalink
Move deprecation warnings to logger output
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Aug 24, 2011
1 parent d13401a commit e13d1e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/sprockets/server.rb
Expand Up @@ -90,7 +90,7 @@ def call(env)
# A third `prefix` argument can be pass along to be prepended to
# the string.
def path(logical_path, fingerprint = true, prefix = nil)
warn "Sprockets::Environment#path is deprecated\n#{caller.join("\n")}"
logger.warn "Sprockets::Environment#path is deprecated\n#{caller[0..2].join("\n")}"
if fingerprint && asset = find_asset(logical_path.to_s.sub(/^\//, ''))
url = asset.digest_path
else
Expand All @@ -106,7 +106,7 @@ def path(logical_path, fingerprint = true, prefix = nil)
# Deprecated: Similar to `path`, `url` returns a full url given a Rack `env`
# Hash and a `logical_path`.
def url(env, logical_path, fingerprint = true, prefix = nil)
warn "Sprockets::Environment#url is deprecated\n#{caller.join("\n")}"
logger.warn "Sprockets::Environment#url is deprecated\n#{caller[0..2].join("\n")}"
req = Rack::Request.new(env)

url = req.scheme + "://"
Expand Down
4 changes: 2 additions & 2 deletions lib/sprockets/static_compilation.rb
Expand Up @@ -19,7 +19,7 @@ def static_root
# Assign a static root directory.
def static_root=(root)
expire_index!
warn "Sprockets::Environment#static_root is deprecated"
logger.warn "Sprockets::Environment#static_root is deprecated\n#{caller[0..2].join("\n")}"
@static_root = root ? Pathname.new(root) : nil
end

Expand All @@ -32,7 +32,7 @@ def static_root=(root)
def precompile(*paths)
options = paths.last.is_a?(Hash) ? paths.pop : {}

warn "Sprockets::Environment#precompile is deprecated"
logger.warn "Sprockets::Environment#precompile is deprecated\n#{caller[0..2].join("\n")}"

if options[:to]
target = options[:to]
Expand Down

0 comments on commit e13d1e8

Please sign in to comment.