From 87ec7009bfdaad292a18b8bbdc9b25522bb9b1a1 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 24 Dec 2016 23:53:46 +0900 Subject: `protected` here doesn't protect anything there aren't any instance method defined in this class --- railties/lib/rails/generators.rb | 51 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 67037106e5..28f8078a9d 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -275,38 +275,37 @@ module Rails end end - protected - def self.print_list(base, namespaces) - namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) } - super - end - - # Try fallbacks for the given base. - def self.invoke_fallbacks_for(name, base) #:nodoc: - return nil unless base && fallbacks[base.to_sym] - invoked_fallbacks = [] + def self.print_list(base, namespaces) + namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) } + super + end - Array(fallbacks[base.to_sym]).each do |fallback| - next if invoked_fallbacks.include?(fallback) - invoked_fallbacks << fallback + # Try fallbacks for the given base. + def self.invoke_fallbacks_for(name, base) #:nodoc: + return nil unless base && fallbacks[base.to_sym] + invoked_fallbacks = [] - klass = find_by_namespace(name, fallback) - return klass if klass - end + Array(fallbacks[base.to_sym]).each do |fallback| + next if invoked_fallbacks.include?(fallback) + invoked_fallbacks << fallback - nil + klass = find_by_namespace(name, fallback) + return klass if klass end - def self.command_type - @command_type ||= "generator" - end + nil + end - def self.lookup_paths - @lookup_paths ||= %w( rails/generators generators ) - end + def self.command_type + @command_type ||= "generator" + end - def self.file_lookup_paths - @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ] - end + def self.lookup_paths + @lookup_paths ||= %w( rails/generators generators ) + end + + def self.file_lookup_paths + @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ] + end end end -- cgit v1.2.3