aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/asset_url_helper.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:48:35 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:48:35 +0200
commit66a7cfa91045e05f134efc9ac0e226e66161e2e6 (patch)
tree39b8554cfe4e27a30be3eed905bc2afcc26cfe89 /actionview/lib/action_view/helpers/asset_url_helper.rb
parentbde6547bb6a8ddf18fb687bf20893d3dc87e0358 (diff)
downloadrails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.tar.gz
rails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.tar.bz2
rails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.zip
applies new string literal convention in actionview/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionview/lib/action_view/helpers/asset_url_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index 8af01617fa..ca9846b90d 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -1,5 +1,5 @@
-require 'zlib'
-require 'active_support/core_ext/regexp'
+require "zlib"
+require "active_support/core_ext/regexp"
module ActionView
# = Action View Asset URL Helpers
@@ -132,10 +132,10 @@ module ActionView
raise ArgumentError, "nil is not a valid asset source" if source.nil?
source = source.to_s
- return '' if source.blank?
+ return "" if source.blank?
return source if URI_REGEXP.match?(source)
- tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, ''.freeze)
+ tail, source = source[/([\?#].+)$/], source.sub(/([\?#].+)$/, "".freeze)
if extname = compute_asset_extname(source, options)
source = "#{source}#{extname}"
@@ -174,8 +174,8 @@ module ActionView
alias_method :url_to_asset, :asset_url # aliased to avoid conflicts with an asset_url named route
ASSET_EXTENSIONS = {
- javascript: '.js',
- stylesheet: '.css'
+ javascript: ".js",
+ stylesheet: ".css"
}
# Compute extname to append to asset path. Returns nil if
@@ -188,12 +188,12 @@ module ActionView
# Maps asset types to public directory.
ASSET_PUBLIC_DIRECTORIES = {
- audio: '/audios',
- font: '/fonts',
- image: '/images',
- javascript: '/javascripts',
- stylesheet: '/stylesheets',
- video: '/videos'
+ audio: "/audios",
+ font: "/fonts",
+ image: "/images",
+ javascript: "/javascripts",
+ stylesheet: "/stylesheets",
+ video: "/videos"
}
# Computes asset path to public directory. Plugins and
@@ -220,7 +220,7 @@ module ActionView
args = [source]
args << request if request && (arity > 1 || arity < 0)
host = host.call(*args)
- elsif host.include?('%d')
+ elsif host.include?("%d")
host = host % (Zlib.crc32(source) % 4)
end
end