aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-06-13 18:36:23 +0900
committerGitHub <noreply@github.com>2019-06-13 18:36:23 +0900
commit98a57aa5f610bc66af31af409c72173cdeeb3c9e (patch)
tree77365fa7eab9725d5ca185ae3df03508898596f5 /railties/lib/rails
parentc5ecc338e863e771adcbcd87d5c23ae5e7ca7894 (diff)
parentc81af6ae723ccfcd601032167d7b7f57c5449c33 (diff)
downloadrails-98a57aa5f610bc66af31af409c72173cdeeb3c9e.tar.gz
rails-98a57aa5f610bc66af31af409c72173cdeeb3c9e.tar.bz2
rails-98a57aa5f610bc66af31af409c72173cdeeb3c9e.zip
Merge pull request #36472 from kamipo/empty_line_only_before_access_modifier
Enable `Layout/EmptyLinesAroundAccessModifier` cop
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/application.rb3
-rw-r--r--railties/lib/rails/application/default_middleware_stack.rb1
-rw-r--r--railties/lib/rails/application/routes_reloader.rb1
-rw-r--r--railties/lib/rails/application_controller.rb1
-rw-r--r--railties/lib/rails/command/spellchecker.rb1
-rw-r--r--railties/lib/rails/engine.rb2
-rw-r--r--railties/lib/rails/generators.rb1
-rw-r--r--railties/lib/rails/generators/actions.rb1
-rw-r--r--railties/lib/rails/generators/actions/create_migration.rb1
-rw-r--r--railties/lib/rails/generators/app_base.rb1
-rw-r--r--railties/lib/rails/generators/base.rb1
-rw-r--r--railties/lib/rails/generators/erb.rb1
-rw-r--r--railties/lib/rails/generators/erb/mailer/mailer_generator.rb1
-rw-r--r--railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb1
-rw-r--r--railties/lib/rails/generators/generated_attribute.rb1
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb2
-rw-r--r--railties/lib/rails/generators/rails/controller/controller_generator.rb1
-rw-r--r--railties/lib/rails/generators/rails/generator/generator_generator.rb1
-rw-r--r--railties/lib/rails/generators/rails/plugin/plugin_generator.rb1
-rw-r--r--railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb1
-rw-r--r--railties/lib/rails/generators/test_unit/generator/generator_generator.rb1
-rw-r--r--railties/lib/rails/generators/test_unit/integration/integration_generator.rb1
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb1
-rw-r--r--railties/lib/rails/generators/testing/behaviour.rb1
-rw-r--r--railties/lib/rails/info_controller.rb1
-rw-r--r--railties/lib/rails/paths.rb2
-rw-r--r--railties/lib/rails/rack/logger.rb1
-rw-r--r--railties/lib/rails/railtie.rb2
-rw-r--r--railties/lib/rails/railtie/configurable.rb1
-rw-r--r--railties/lib/rails/railtie/configuration.rb1
30 files changed, 0 insertions, 36 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 038284ebdd..dd1770f0ea 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -501,7 +501,6 @@ module Rails
end
protected
-
alias :build_middleware_stack :app
def run_tasks_blocks(app) #:nodoc:
@@ -581,7 +580,6 @@ module Rails
end
private
-
def generate_development_secret
if secrets.secret_key_base.nil?
key_file = Rails.root.join("tmp/development_secret.txt")
@@ -623,7 +621,6 @@ module Rails
end
private
-
def convert_key(key)
unless key.kind_of?(Symbol)
ActiveSupport::Deprecation.warn(<<~MESSAGE.squish)
diff --git a/railties/lib/rails/application/default_middleware_stack.rb b/railties/lib/rails/application/default_middleware_stack.rb
index 9800b19274..3659c0ac3a 100644
--- a/railties/lib/rails/application/default_middleware_stack.rb
+++ b/railties/lib/rails/application/default_middleware_stack.rb
@@ -79,7 +79,6 @@ module Rails
end
private
-
def load_rack_cache
rack_cache = config.action_dispatch.rack_cache
return unless rack_cache
diff --git a/railties/lib/rails/application/routes_reloader.rb b/railties/lib/rails/application/routes_reloader.rb
index 3ecb8e264e..1070362253 100644
--- a/railties/lib/rails/application/routes_reloader.rb
+++ b/railties/lib/rails/application/routes_reloader.rb
@@ -25,7 +25,6 @@ module Rails
end
private
-
def updater
@updater ||= ActiveSupport::FileUpdateChecker.new(paths) { reload! }
end
diff --git a/railties/lib/rails/application_controller.rb b/railties/lib/rails/application_controller.rb
index b3fe822218..8c00633515 100644
--- a/railties/lib/rails/application_controller.rb
+++ b/railties/lib/rails/application_controller.rb
@@ -12,7 +12,6 @@ class Rails::ApplicationController < ActionController::Base # :nodoc:
end
private
-
def require_local!
unless local_request?
render html: "<p>For security purposes, this information is only available to local requests.</p>".html_safe, status: :forbidden
diff --git a/railties/lib/rails/command/spellchecker.rb b/railties/lib/rails/command/spellchecker.rb
index 085d5b16df..c5d0253185 100644
--- a/railties/lib/rails/command/spellchecker.rb
+++ b/railties/lib/rails/command/spellchecker.rb
@@ -13,7 +13,6 @@ module Rails
end
private
-
# This code is based directly on the Text gem implementation.
# Copyright (c) 2006-2013 Paul Battley, Michael Neumann, Tim Fletcher.
#
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index d1b8c7803f..46f1d38b96 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -654,14 +654,12 @@ module Rails
end
protected
-
def run_tasks_blocks(*) #:nodoc:
super
paths["lib/tasks"].existent.sort.each { |ext| load(ext) }
end
private
-
def load_config_initializer(initializer) # :doc:
ActiveSupport::Notifications.instrument("load_config_initializer.railties", initializer: initializer) do
load(initializer)
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index 0be00d5151..709863275d 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -287,7 +287,6 @@ module Rails
end
private
-
def print_list(base, namespaces) # :doc:
namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) }
super
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index 1a5f2ff203..406a5b8fc7 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -268,7 +268,6 @@ module Rails
end
private
-
# Define log for backwards compatibility. If just one argument is sent,
# invoke say, otherwise invoke say_status. Differently from say and
# similarly to say_status, this method respects the quiet? option given.
diff --git a/railties/lib/rails/generators/actions/create_migration.rb b/railties/lib/rails/generators/actions/create_migration.rb
index 05bc242447..67a8139cd3 100644
--- a/railties/lib/rails/generators/actions/create_migration.rb
+++ b/railties/lib/rails/generators/actions/create_migration.rb
@@ -40,7 +40,6 @@ module Rails
alias :exists? :existing_migration
private
-
def on_conflict_behavior # :doc:
options = base.options.merge(config)
if identical?
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 303073d867..dbfb7337f0 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -108,7 +108,6 @@ module Rails
end
private
-
def gemfile_entry(name, *args) # :doc:
options = args.extract_options!
version = args.first
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index 5523a3f659..0b91e3223e 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -245,7 +245,6 @@ module Rails
end
private
-
# Check whether the given class names are already taken by user
# application or Ruby on Rails.
def class_collisions(*class_names)
diff --git a/railties/lib/rails/generators/erb.rb b/railties/lib/rails/generators/erb.rb
index ba20bcd32a..aab2d634d3 100644
--- a/railties/lib/rails/generators/erb.rb
+++ b/railties/lib/rails/generators/erb.rb
@@ -6,7 +6,6 @@ module Erb # :nodoc:
module Generators # :nodoc:
class Base < Rails::Generators::NamedBase #:nodoc:
private
-
def formats
[format]
end
diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
index 997602cb8c..f66be1ee44 100644
--- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
+++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb
@@ -29,7 +29,6 @@ module Erb # :nodoc:
end
private
-
def formats
[:text, :html]
end
diff --git a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb
index 2fc04e4094..6d3bccab0b 100644
--- a/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb
+++ b/railties/lib/rails/generators/erb/scaffold/scaffold_generator.rb
@@ -24,7 +24,6 @@ module Erb # :nodoc:
end
private
-
def available_views
%w(index edit show new _form)
end
diff --git a/railties/lib/rails/generators/generated_attribute.rb b/railties/lib/rails/generators/generated_attribute.rb
index 1a80e71eae..4e348be9be 100644
--- a/railties/lib/rails/generators/generated_attribute.rb
+++ b/railties/lib/rails/generators/generated_attribute.rb
@@ -39,7 +39,6 @@ module Rails
end
private
-
# parse possible attribute options like :limit for string/text/binary/integer, :precision/:scale for decimals or :polymorphic for references/belongs_to
# when declaring options curly brackets should be used
def parse_type_and_options(type)
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 578881d1ac..ea3968bf39 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -497,7 +497,6 @@ module Rails
# :startdoc:
private
-
# Define file as an alias to create_file for backwards compatibility.
def file(*args, &block)
create_file(*args, &block)
@@ -542,7 +541,6 @@ module Rails
end
private
-
def handle_version_request!(argument)
if ["--version", "-v"].include?(argument)
require "rails/version"
diff --git a/railties/lib/rails/generators/rails/controller/controller_generator.rb b/railties/lib/rails/generators/rails/controller/controller_generator.rb
index eb75e7e661..88729545f3 100644
--- a/railties/lib/rails/generators/rails/controller/controller_generator.rb
+++ b/railties/lib/rails/generators/rails/controller/controller_generator.rb
@@ -25,7 +25,6 @@ module Rails
end
private
-
def file_name
@_file_name ||= remove_possible_suffix(super)
end
diff --git a/railties/lib/rails/generators/rails/generator/generator_generator.rb b/railties/lib/rails/generators/rails/generator/generator_generator.rb
index 747acd68d1..b0146641b4 100644
--- a/railties/lib/rails/generators/rails/generator/generator_generator.rb
+++ b/railties/lib/rails/generators/rails/generator/generator_generator.rb
@@ -15,7 +15,6 @@ module Rails
hook_for :test_framework
private
-
def generator_dir
if options[:namespace]
File.join("lib", "generators", regular_class_path, file_name)
diff --git a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
index 895b3b2e92..4c18bdb430 100644
--- a/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
+++ b/railties/lib/rails/generators/rails/plugin/plugin_generator.rb
@@ -269,7 +269,6 @@ task default: :test
end
private
-
def create_dummy_app(path = nil)
dummy_path(path) if path
diff --git a/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb b/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
index e1ca54ec91..b2cdeee6d1 100644
--- a/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
+++ b/railties/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb
@@ -34,7 +34,6 @@ module Rails
end
private
-
def permitted_params
attachments, others = attributes_names.partition { |name| attachments?(name) }
params = others.map { |name| ":#{name}" }
diff --git a/railties/lib/rails/generators/test_unit/generator/generator_generator.rb b/railties/lib/rails/generators/test_unit/generator/generator_generator.rb
index 19be4f2f51..ae7e28580e 100644
--- a/railties/lib/rails/generators/test_unit/generator/generator_generator.rb
+++ b/railties/lib/rails/generators/test_unit/generator/generator_generator.rb
@@ -15,7 +15,6 @@ module TestUnit # :nodoc:
end
private
-
def generator_path
if options[:namespace]
File.join("generators", regular_class_path, file_name, "#{file_name}_generator")
diff --git a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb b/railties/lib/rails/generators/test_unit/integration/integration_generator.rb
index ba27ed329b..86fea3f677 100644
--- a/railties/lib/rails/generators/test_unit/integration/integration_generator.rb
+++ b/railties/lib/rails/generators/test_unit/integration/integration_generator.rb
@@ -12,7 +12,6 @@ module TestUnit # :nodoc:
end
private
-
def file_name
@_file_name ||= super.sub(/_test\z/i, "")
end
diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
index 26002a0704..a4bc81cad6 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
+++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
@@ -38,7 +38,6 @@ module TestUnit # :nodoc:
end
private
-
def attributes_string
attributes_hash.map { |k, v| "#{k}: #{v}" }.join(", ")
end
diff --git a/railties/lib/rails/generators/testing/behaviour.rb b/railties/lib/rails/generators/testing/behaviour.rb
index ec29ad12ba..a092faec89 100644
--- a/railties/lib/rails/generators/testing/behaviour.rb
+++ b/railties/lib/rails/generators/testing/behaviour.rb
@@ -88,7 +88,6 @@ module Rails
end
private
-
def destination_root_is_set?
raise "You need to configure your Rails::Generators::TestCase destination root." unless destination_root
end
diff --git a/railties/lib/rails/info_controller.rb b/railties/lib/rails/info_controller.rb
index f74d979721..d51010d422 100644
--- a/railties/lib/rails/info_controller.rb
+++ b/railties/lib/rails/info_controller.rb
@@ -33,7 +33,6 @@ class Rails::InfoController < Rails::ApplicationController # :nodoc:
end
private
-
def match_route
_routes.routes.select { |route|
yield route.path
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index 8367ac8980..838fe55acc 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -98,7 +98,6 @@ module Rails
end
private
-
def filter_by(&block)
all_paths.find_all(&block).flat_map { |path|
paths = path.existent
@@ -223,7 +222,6 @@ module Rails
alias to_a expanded
private
-
def files_in(path)
Dir.chdir(path) do
files = Dir.glob(@glob)
diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb
index 3a95b55811..8d69663dbd 100644
--- a/railties/lib/rails/rack/logger.rb
+++ b/railties/lib/rails/rack/logger.rb
@@ -30,7 +30,6 @@ module Rails
end
private
-
def call_app(request, env) # :doc:
instrumenter = ActiveSupport::Notifications.instrumenter
instrumenter.start "request.action_dispatch", request: request
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb
index a67b90e285..178c584f95 100644
--- a/railties/lib/rails/railtie.rb
+++ b/railties/lib/rails/railtie.rb
@@ -228,7 +228,6 @@ module Rails
end
protected
-
def run_console_blocks(app) #:nodoc:
each_registered_block(:console) { |block| block.call(app) }
end
@@ -247,7 +246,6 @@ module Rails
end
private
-
# run `&block` in every registered block in `#register_block_for`
def each_registered_block(type, &block)
klass = self.class
diff --git a/railties/lib/rails/railtie/configurable.rb b/railties/lib/rails/railtie/configurable.rb
index 7f42fae10a..ba14089a2a 100644
--- a/railties/lib/rails/railtie/configurable.rb
+++ b/railties/lib/rails/railtie/configurable.rb
@@ -27,7 +27,6 @@ module Rails
end
private
-
def method_missing(*args, &block)
instance.send(*args, &block)
end
diff --git a/railties/lib/rails/railtie/configuration.rb b/railties/lib/rails/railtie/configuration.rb
index 70274b948c..c90fcac51a 100644
--- a/railties/lib/rails/railtie/configuration.rb
+++ b/railties/lib/rails/railtie/configuration.rb
@@ -87,7 +87,6 @@ module Rails
end
private
-
def method_missing(name, *args, &blk)
if name.to_s =~ /=$/
@@options[$`.to_sym] = args.first