aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2016-08-30 10:26:13 -0500
committerschneems <richard.schneeman@gmail.com>2016-08-30 10:26:13 -0500
commit3ee9d0061fa042a9fcffa864ffa1492a00d0d179 (patch)
tree853fc115d07a2672d5f2d9ea741815eb219a690a /actionview
parente1791d1dd4820157654e59d2e9315b4975e3c36a (diff)
downloadrails-3ee9d0061fa042a9fcffa864ffa1492a00d0d179.tar.gz
rails-3ee9d0061fa042a9fcffa864ffa1492a00d0d179.tar.bz2
rails-3ee9d0061fa042a9fcffa864ffa1492a00d0d179.zip
Address comment via @dhh, better option naming
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/asset_tag_helper.rb16
-rw-r--r--actionview/lib/action_view/helpers/asset_url_helper.rb22
2 files changed, 19 insertions, 19 deletions
diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb
index 8dc879611c..9c22fb0bde 100644
--- a/actionview/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb
@@ -56,7 +56,7 @@ module ActionView
# # => <script src="http://www.example.com/xmlhr.js"></script>
def javascript_include_tag(*sources)
options = sources.extract_options!.stringify_keys
- path_options = options.extract!("protocol", "extname", "host", "public_folder").symbolize_keys
+ path_options = options.extract!("protocol", "extname", "host", "skip_pipeline").symbolize_keys
sources.uniq.map { |source|
tag_options = {
"src" => path_to_javascript(source, path_options)
@@ -92,7 +92,7 @@ module ActionView
# # <link href="/css/stylish.css" media="screen" rel="stylesheet" />
def stylesheet_link_tag(*sources)
options = sources.extract_options!.stringify_keys
- path_options = options.extract!("protocol", "host", "public_folder").symbolize_keys
+ path_options = options.extract!("protocol", "host", "skip_pipeline").symbolize_keys
sources.uniq.map { |source|
tag_options = {
"rel" => "stylesheet",
@@ -173,7 +173,7 @@ module ActionView
tag("link", {
rel: "shortcut icon",
type: "image/x-icon",
- href: path_to_image(source, public_folder: options.delete(:public_folder))
+ href: path_to_image(source, skip_pipeline: options.delete(:skip_pipeline))
}.merge!(options.symbolize_keys))
end
@@ -211,7 +211,7 @@ module ActionView
options = options.symbolize_keys
check_for_image_tag_errors(options)
- src = options[:src] = path_to_image(source, public_folder: options.delete(:public_folder))
+ src = options[:src] = path_to_image(source, skip_pipeline: options.delete(:skip_pipeline))
unless src.start_with?("cid:") || src.start_with?("data:") || src.blank?
options[:alt] = options.fetch(:alt) { image_alt(src) }
@@ -289,7 +289,7 @@ module ActionView
public_poster_folder = options.delete(:public_poster_folder)
sources << options
multiple_sources_tag_builder("video", sources) do |options|
- options[:poster] = path_to_image(options[:poster], public_folder: public_poster_folder) if options[:poster]
+ options[:poster] = path_to_image(options[:poster], skip_pipeline: public_poster_folder) if options[:poster]
options[:width], options[:height] = extract_dimensions(options.delete(:size)) if options[:size]
end
end
@@ -313,17 +313,17 @@ module ActionView
private
def multiple_sources_tag_builder(type, sources)
options = sources.extract_options!.symbolize_keys
- public_folder = options.delete(:public_folder)
+ skip_pipeline = options.delete(:skip_pipeline)
sources.flatten!
yield options if block_given?
if sources.size > 1
content_tag(type, options) do
- safe_join sources.map { |source| tag("source", src: send("path_to_#{type}", source, public_folder: public_folder)) }
+ safe_join sources.map { |source| tag("source", src: send("path_to_#{type}", source, skip_pipeline: skip_pipeline)) }
end
else
- options[:src] = send("path_to_#{type}", sources.first, public_folder: public_folder)
+ options[:src] = send("path_to_#{type}", sources.first, skip_pipeline: skip_pipeline)
content_tag(type, nil, options)
end
end
diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb
index dc46cad410..d1f85d3319 100644
--- a/actionview/lib/action_view/helpers/asset_url_helper.rb
+++ b/actionview/lib/action_view/helpers/asset_url_helper.rb
@@ -121,7 +121,7 @@ module ActionView
# This is the entry point for all assets.
# When using the asset pipeline (i.e. sprockets and sprockets-rails), the
# behavior is "enhanced". You can bypass the asset pipeline by passing in
- # <tt>public_folder: true</tt> to the options.
+ # <tt>skip_pipeline: true</tt> to the options.
#
# All other asset *_path helpers delegate through this method.
#
@@ -132,16 +132,16 @@ module ActionView
#
# asset_path("application.js") # => "/assets/application-60aa4fdc5cea14baf5400fba1abf4f2a46a5166bad4772b1effe341570f07de9.js"
#
- # === Without the asset pipeline (<tt>public_folder: true</tt>)
+ # === Without the asset pipeline (<tt>skip_pipeline: true</tt>)
#
# Accepts a <tt>type</tt> option that can specify the asset's extension. No error
# checking is done to verify the source passed into +asset_path+ is valid
# and that the file exists on disk.
#
- # asset_path("application.js", public_folder: true) # => "application.js"
- # asset_path("filedoesnotexist.png", public_folder: true) # => "filedoesnotexist.png"
- # asset_path("application", type: :javascript, public_folder: true) # => "/javascripts/application.js"
- # asset_path("application", type: :stylesheet, public_folder: true) # => "/stylesheets/application.css"
+ # asset_path("application.js", skip_pipeline: true) # => "application.js"
+ # asset_path("filedoesnotexist.png", skip_pipeline: true) # => "filedoesnotexist.png"
+ # asset_path("application", type: :javascript, skip_pipeline: true) # => "/javascripts/application.js"
+ # asset_path("application", type: :stylesheet, skip_pipeline: true) # => "/stylesheets/application.css"
#
# === Options applying to all assets
#
@@ -167,18 +167,18 @@ module ActionView
# root prepended.
#
# Rails.application.config.relative_url_root = "bar"
- # asset_path("foo.js", public_folder: true) # => "bar/foo.js"
+ # asset_path("foo.js", skip_pipeline: true) # => "bar/foo.js"
#
# - A different asset host can be specified via <tt>config.action_controller.asset_host</tt>
# this is commonly used in conjunction with a CDN.
#
# Rails.application.config.action_controller.asset_host = "assets.example.com"
- # asset_path("foo.js", public_folder: true) # => "http://assets.example.com/foo.js"
+ # asset_path("foo.js", skip_pipeline: true) # => "http://assets.example.com/foo.js"
#
# - An extension name can be specified manually with <tt>extname</tt>.
#
- # asset_path("foo", public_folder: true, extname: ".js") # => "/foo.js"
- # asset_path("foo.css", public_folder: true, extname: ".js") # => "/foo.css.js"
+ # asset_path("foo", skip_pipeline: true, extname: ".js") # => "/foo.js"
+ # asset_path("foo.css", skip_pipeline: true, extname: ".js") # => "/foo.css.js"
def asset_path(source, options = {})
raise ArgumentError, "nil is not a valid asset source" if source.nil?
@@ -193,7 +193,7 @@ module ActionView
end
if source[0] != ?/
- if options[:public_folder]
+ if options[:skip_pipeline]
source = public_compute_asset_path(source, options)
else
source = compute_asset_path(source, options)