Permalink
Browse files

Use Hash#fetch instead of testing for #key?

  • Loading branch information...
1 parent 9b9838e commit 6960e481cb87964bd450ec3fbaa1087f44c3b860 @carlosantoniodasilva carlosantoniodasilva committed Feb 13, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 actionpack/lib/sprockets/railtie.rb
  2. +2 −2 actionpack/lib/sprockets/static_compiler.rb
@@ -24,7 +24,7 @@ class Railtie < ::Rails::Railtie
env.version = ::Rails.env + "-#{config.assets.version}"
if config.assets.logger != false
- env.logger = config.assets.logger || ::Rails.logger
+ env.logger = config.assets.logger || ::Rails.logger
end
if config.assets.cache_store != false
@@ -8,8 +8,8 @@ def initialize(env, target, paths, options = {})
@env = env
@target = target
@paths = paths
- @digest = options.key?(:digest) ? options.delete(:digest) : true
- @manifest = options.key?(:manifest) ? options.delete(:manifest) : true
+ @digest = options.fetch(:digest, true)
+ @manifest = options.fetch(:manifest, true)
@manifest_path = options.delete(:manifest_path) || target
@zip_files = options.delete(:zip_files) || /\.(?:css|html|js|svg|txt|xml)$/
end

0 comments on commit 6960e48

Please sign in to comment.