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

Remove :api: tag that has leaked on the doc directly [ci skip]

Currently `:api:` tag has leaked on the doc directly since RDoc doesn't
support `:api:` tag directive.

http://api.rubyonrails.org/v5.1/classes/AbstractController/Rendering.html

So `:api: private` doesn't work as expected. We are using `:nodoc:` for
the purpose.

Related #13989.
This commit is contained in:
Ryuta Kamizono 2017-09-30 18:33:53 +09:00
parent 285f9a89d5
commit 5349f23108
6 changed files with 4 additions and 29 deletions

View file

@ -180,8 +180,6 @@ module AbstractController
# #
# ==== Parameters # ==== Parameters
# * <tt>name</tt> - The name of an action to be tested # * <tt>name</tt> - The name of an action to be tested
#
# :api: private
def action_method?(name) def action_method?(name)
self.class.action_methods.include?(name) self.class.action_methods.include?(name)
end end

View file

@ -20,7 +20,6 @@ module AbstractController
# Normalizes arguments, options and then delegates render_to_body and # Normalizes arguments, options and then delegates render_to_body and
# sticks the result in <tt>self.response_body</tt>. # sticks the result in <tt>self.response_body</tt>.
# :api: public
def render(*args, &block) def render(*args, &block)
options = _normalize_render(*args, &block) options = _normalize_render(*args, &block)
rendered_body = render_to_body(options) rendered_body = render_to_body(options)
@ -42,19 +41,16 @@ module AbstractController
# (as ActionController extends it to be anything that # (as ActionController extends it to be anything that
# responds to the method each), this method needs to be # responds to the method each), this method needs to be
# overridden in order to still return a string. # overridden in order to still return a string.
# :api: plugin
def render_to_string(*args, &block) def render_to_string(*args, &block)
options = _normalize_render(*args, &block) options = _normalize_render(*args, &block)
render_to_body(options) render_to_body(options)
end end
# Performs the actual template rendering. # Performs the actual template rendering.
# :api: public
def render_to_body(options = {}) def render_to_body(options = {})
end end
# Returns Content-Type of rendered content # Returns Content-Type of rendered content.
# :api: public
def rendered_format def rendered_format
Mime[:text] Mime[:text]
end end
@ -65,7 +61,6 @@ module AbstractController
# This method should return a hash with assigns. # This method should return a hash with assigns.
# You can overwrite this configuration per controller. # You can overwrite this configuration per controller.
# :api: public
def view_assigns def view_assigns
protected_vars = _protected_ivars protected_vars = _protected_ivars
variables = instance_variables variables = instance_variables
@ -79,7 +74,6 @@ module AbstractController
# Normalize args by converting <tt>render "foo"</tt> to # Normalize args by converting <tt>render "foo"</tt> to
# <tt>render :action => "foo"</tt> and <tt>render "foo/bar"</tt> to # <tt>render :action => "foo"</tt> and <tt>render "foo/bar"</tt> to
# <tt>render :file => "foo/bar"</tt>. # <tt>render :file => "foo/bar"</tt>.
# :api: plugin
def _normalize_args(action = nil, options = {}) def _normalize_args(action = nil, options = {})
if action.respond_to?(:permitted?) if action.respond_to?(:permitted?)
if action.permitted? if action.permitted?
@ -95,20 +89,17 @@ module AbstractController
end end
# Normalize options. # Normalize options.
# :api: plugin
def _normalize_options(options) def _normalize_options(options)
options options
end end
# Process extra options. # Process extra options.
# :api: plugin
def _process_options(options) def _process_options(options)
options options
end end
# Process the rendered format. # Process the rendered format.
# :api: private def _process_format(format) # :nodoc:
def _process_format(format)
end end
def _process_variant(options) def _process_variant(options)
@ -121,8 +112,7 @@ module AbstractController
end end
# Normalize args and options. # Normalize args and options.
# :api: private def _normalize_render(*args, &block) # :nodoc:
def _normalize_render(*args, &block)
options = _normalize_args(*args, &block) options = _normalize_args(*args, &block)
_process_variant(options) _process_variant(options)
_normalize_options(options) _normalize_options(options)

View file

@ -83,15 +83,12 @@ module ActionController
# def cleanup_view_runtime # def cleanup_view_runtime
# super - time_taken_in_something_expensive # super - time_taken_in_something_expensive
# end # end
#
# :api: plugin
def cleanup_view_runtime def cleanup_view_runtime
yield yield
end end
# Every time after an action is processed, this method is invoked # Every time after an action is processed, this method is invoked
# with the payload, so you can add more information. # with the payload, so you can add more information.
# :api: plugin
def append_info_to_payload(payload) def append_info_to_payload(payload)
payload[:view_runtime] = view_runtime payload[:view_runtime] = view_runtime
end end
@ -100,7 +97,6 @@ module ActionController
# A hook which allows other frameworks to log what happened during # A hook which allows other frameworks to log what happened during
# controller process action. This method should return an array # controller process action. This method should return an array
# with the messages to be added. # with the messages to be added.
# :api: plugin
def log_process_action(payload) #:nodoc: def log_process_action(payload) #:nodoc:
messages, view_runtime = [], payload[:view_runtime] messages, view_runtime = [], payload[:view_runtime]
messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime messages << ("Views: %.1fms" % view_runtime.to_f) if view_runtime

View file

@ -47,7 +47,6 @@ module Dispatching
end end
class BaseTest < Rack::TestCase class BaseTest < Rack::TestCase
# :api: plugin
test "simple dispatching" do test "simple dispatching" do
get "/dispatching/simple/index" get "/dispatching/simple/index"
@ -56,14 +55,12 @@ module Dispatching
assert_content_type "text/plain; charset=utf-8" assert_content_type "text/plain; charset=utf-8"
end end
# :api: plugin
test "directly modifying response body" do test "directly modifying response body" do
get "/dispatching/simple/modify_response_body" get "/dispatching/simple/modify_response_body"
assert_body "success" assert_body "success"
end end
# :api: plugin
test "directly modifying response body twice" do test "directly modifying response body twice" do
get "/dispatching/simple/modify_response_body_twice" get "/dispatching/simple/modify_response_body_twice"

View file

@ -19,7 +19,6 @@ module ActionView
attr_accessor :output_buffer, :view_flow attr_accessor :output_buffer, :view_flow
# Prepares the context by setting the appropriate instance variables. # Prepares the context by setting the appropriate instance variables.
# :api: plugin
def _prepare_context def _prepare_context
@view_flow = OutputFlow.new @view_flow = OutputFlow.new
@output_buffer = nil @output_buffer = nil
@ -29,7 +28,6 @@ module ActionView
# Encapsulates the interaction with the view flow so it # Encapsulates the interaction with the view flow so it
# returns the correct buffer on +yield+. This is usually # returns the correct buffer on +yield+. This is usually
# overwritten by helpers to add more behavior. # overwritten by helpers to add more behavior.
# :api: plugin
def _layout_for(name = nil) def _layout_for(name = nil)
name ||= :layout name ||= :layout
view_flow.get(name).html_safe view_flow.get(name).html_safe

View file

@ -75,8 +75,7 @@ module ActionView
end end
# Returns an object that is able to render templates. # Returns an object that is able to render templates.
# :api: private def view_renderer # :nodoc:
def view_renderer
@_view_renderer ||= ActionView::Renderer.new(lookup_context) @_view_renderer ||= ActionView::Renderer.new(lookup_context)
end end
@ -92,7 +91,6 @@ module ActionView
private private
# Find and render a template based on the options given. # Find and render a template based on the options given.
# :api: private
def _render_template(options) def _render_template(options)
variant = options.delete(:variant) variant = options.delete(:variant)
assigns = options.delete(:assigns) assigns = options.delete(:assigns)
@ -114,7 +112,6 @@ module ActionView
# Normalize args by converting render "foo" to render :action => "foo" and # Normalize args by converting render "foo" to render :action => "foo" and
# render "foo/bar" to render :template => "foo/bar". # render "foo/bar" to render :template => "foo/bar".
# :api: private
def _normalize_args(action = nil, options = {}) def _normalize_args(action = nil, options = {})
options = super(action, options) options = super(action, options)
case action case action
@ -137,7 +134,6 @@ module ActionView
end end
# Normalize options. # Normalize options.
# :api: private
def _normalize_options(options) def _normalize_options(options)
options = super(options) options = super(options)
if options[:partial] == true if options[:partial] == true