From 5faa9a235c46037a3b8e4f3308fd7ccadaae8039 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Thu, 27 Oct 2016 00:13:15 +0300 Subject: Add missing `+` around a some literals. Mainly around `nil` [ci skip] --- .../lib/action_view/helpers/asset_url_helper.rb | 4 ++-- .../lib/action_view/helpers/atom_feed_helper.rb | 4 ++-- actionview/lib/action_view/helpers/date_helper.rb | 4 ++-- actionview/lib/action_view/helpers/text_helper.rb | 2 +- actionview/lib/action_view/layouts.rb | 28 +++++++++++----------- .../lib/action_view/renderer/partial_renderer.rb | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/asset_url_helper.rb b/actionview/lib/action_view/helpers/asset_url_helper.rb index e0de2ff4d6..79305d4880 100644 --- a/actionview/lib/action_view/helpers/asset_url_helper.rb +++ b/actionview/lib/action_view/helpers/asset_url_helper.rb @@ -98,7 +98,7 @@ module ActionView # to avoid warnings in the client about mixed media. # Note that the request parameter might not be supplied, e.g. when the assets # are precompiled via a Rake task. Make sure to use a Proc instead of a lambda, - # since a Proc allows missing parameters and sets them to nil. + # since a +Proc+ allows missing parameters and sets them to +nil+. # # config.action_controller.asset_host = Proc.new { |source, request| # if request && request.ssl? @@ -233,7 +233,7 @@ module ActionView stylesheet: ".css" } - # Compute extname to append to asset path. Returns nil if + # Compute extname to append to asset path. Returns +nil+ if # nothing should be added. def compute_asset_extname(source, options = {}) return if options[:extname] == false diff --git a/actionview/lib/action_view/helpers/atom_feed_helper.rb b/actionview/lib/action_view/helpers/atom_feed_helper.rb index 09d243c46d..293662838f 100644 --- a/actionview/lib/action_view/helpers/atom_feed_helper.rb +++ b/actionview/lib/action_view/helpers/atom_feed_helper.rb @@ -163,7 +163,7 @@ module ActionView @xml, @view, @feed_options = xml, view, feed_options end - # Accepts a Date or Time object and inserts it in the proper format. If nil is passed, current time in UTC is used. + # Accepts a Date or Time object and inserts it in the proper format. If +nil+ is passed, current time in UTC is used. def updated(date_or_time = nil) @xml.updated((date_or_time || Time.now.utc).xmlschema) end @@ -174,7 +174,7 @@ module ActionView # # * :published: Time first published. Defaults to the created_at attribute on the record if one such exists. # * :updated: Time of update. Defaults to the updated_at attribute on the record if one such exists. - # * :url: The URL for this entry or false or nil for not having a link tag. Defaults to the polymorphic_url for the record. + # * :url: The URL for this entry or +false+ or +nil+ for not having a link tag. Defaults to the +polymorphic_url+ for the record. # * :id: The ID for this entry. Defaults to "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}" # * :type: The TYPE for this entry. Defaults to "text/html". def entry(record, options = {}) diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb index 04c5fd4218..206c63b295 100644 --- a/actionview/lib/action_view/helpers/date_helper.rb +++ b/actionview/lib/action_view/helpers/date_helper.rb @@ -220,7 +220,7 @@ module ActionView # the respective locale (e.g. [:year, :month, :day] in the en locale that ships with Rails). # * :include_blank - Include a blank option in every select field so it's possible to set empty # dates. - # * :default - Set a default date if the affected date isn't set or is nil. + # * :default - Set a default date if the affected date isn't set or is +nil+. # * :selected - Set a date that overrides the actual value. # * :disabled - Set to true if you want show the select fields as disabled. # * :prompt - Set to true (for a generic prompt), a prompt string or a hash of prompt strings @@ -866,7 +866,7 @@ module ActionView end # Returns translated month names, but also ensures that a custom month - # name array has a leading nil element. + # name array has a leading +nil+ element. def month_names @month_names ||= begin month_names = @options[:use_month_names] || translated_month_names diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index bd3371ccc8..07dccf5b41 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -151,7 +151,7 @@ module ActionView # defined in :radius (which defaults to 100). If the excerpt radius overflows the beginning or end of the +text+, # then the :omission option (which defaults to "...") will be prepended/appended accordingly. Use the # :separator option to choose the delimitation. The resulting string will be stripped in any case. If the +phrase+ - # isn't found, nil is returned. + # isn't found, +nil+ is returned. # # excerpt('This is an example', 'an', radius: 5) # # => ...s is an exam... diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index b083de1396..049d28f261 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -92,16 +92,16 @@ module ActionView # layout false # # In these examples, we have three implicit lookup scenarios: - # * The BankController uses the "bank" layout. - # * The ExchangeController uses the "exchange" layout. - # * The CurrencyController inherits the layout from BankController. + # * The +BankController+ uses the "bank" layout. + # * The +ExchangeController+ uses the "exchange" layout. + # * The +CurrencyController+ inherits the layout from BankController. # # However, when a layout is explicitly set, the explicitly set layout wins: - # * The InformationController uses the "information" layout, explicitly set. - # * The TellerController also uses the "information" layout, because the parent explicitly set it. - # * The EmployeeController uses the "employee" layout, because it set the layout to nil, resetting the parent configuration. - # * The VaultController chooses a layout dynamically by calling the access_level_layout method. - # * The TillController does not use a layout at all. + # * The +InformationController+ uses the "information" layout, explicitly set. + # * The +TellerController+ also uses the "information" layout, because the parent explicitly set it. + # * The +EmployeeController+ uses the "employee" layout, because it set the layout to +nil+, resetting the parent configuration. + # * The +VaultController+ chooses a layout dynamically by calling the access_level_layout method. + # * The +TillController+ does not use a layout at all. # # == Types of layouts # @@ -149,8 +149,8 @@ module ActionView # The template will be looked always in app/views/layouts/ folder. But you can point # layouts folder direct also. layout "layouts/demo" is the same as layout "demo". # - # Setting the layout to nil forces it to be looked up in the filesystem and fallbacks to the parent behavior if none exists. - # Setting it to nil is useful to re-enable template lookup overriding a previous configuration set in the parent: + # Setting the layout to +nil+ forces it to be looked up in the filesystem and fallbacks to the parent behavior if none exists. + # Setting it to +nil+ is useful to re-enable template lookup overriding a previous configuration set in the parent: # # class ApplicationController < ActionController::Base # layout "application" @@ -255,7 +255,7 @@ module ActionView # true:: raise an ArgumentError # nil:: Force default layout behavior with inheritance # - # Return value of Proc & Symbol arguments should be String, false, true or nil + # Return value of +Proc & Symbol+ arguments should be +String+, +false+, +true+ or +nil+ # with the same meaning as described above. # ==== Parameters # * layout - The layout to use. @@ -405,11 +405,11 @@ module ActionView # # ==== Parameters # * formats - The formats accepted to this layout - # * require_layout - If set to true and layout is not found, - # an +ArgumentError+ exception is raised (defaults to false) + # * require_layout - If set to +true+ and layout is not found, + # an +ArgumentError+ exception is raised (defaults to +false+) # # ==== Returns - # * template - The template object for the default layout (or nil) + # * template - The template object for the default layout (or +nil+) def _default_layout(formats, require_layout = false) begin value = _layout(formats) if action_has_layout? diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb index dfe38c488f..dfa6a629b4 100644 --- a/actionview/lib/action_view/renderer/partial_renderer.rb +++ b/actionview/lib/action_view/renderer/partial_renderer.rb @@ -99,7 +99,7 @@ module ActionView # # <%= render partial: "ad", collection: @advertisements, spacer_template: "ad_divider" %> # - # If the given :collection is nil or empty, render will return nil. This will allow you + # If the given :collection is +nil+ or empty, render will return nil. This will allow you # to specify a text which will displayed instead by using this form: # # <%= render(partial: "ad", collection: @advertisements) || "There's no ad to be displayed" %> -- cgit v1.2.3