1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

use Hash#delete with a default block

This commit is contained in:
Aaron Patterson 2012-02-20 14:47:56 -08:00
parent 4b45fcffea
commit 563df87f19

View file

@ -19,9 +19,9 @@ module Sprockets
def javascript_include_tag(*sources)
options = sources.extract_options!
debug = options.key?(:debug) ? options.delete(:debug) : debug_assets?
body = options.key?(:body) ? options.delete(:body) : false
digest = options.key?(:digest) ? options.delete(:digest) : digest_assets?
debug = options.delete(:debug) { debug_assets? }
body = options.delete(:body) { false }
digest = options.delete(:digest) { digest_assets? }
sources.collect do |source|
if debug && asset = asset_paths.asset_for(source, 'js')