aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-12-25 00:00:08 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-12-25 02:11:39 +0900
commit6b049057f0e7b21235ee88900d56f99ac527eecf (patch)
tree52c14949f7298297fb1bf06b386e37666406003d
parentf9caa5a6dd99275aa9400ab64813a850a26a0386 (diff)
downloadrails-6b049057f0e7b21235ee88900d56f99ac527eecf.tar.gz
rails-6b049057f0e7b21235ee88900d56f99ac527eecf.tar.bz2
rails-6b049057f0e7b21235ee88900d56f99ac527eecf.zip
Privatize some methods that were originally protected
-rw-r--r--railties/lib/rails/generators.rb52
1 files changed, 27 insertions, 25 deletions
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index 04f4908f52..e1980a42ad 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -274,38 +274,40 @@ module Rails
end
end
- def print_list(base, namespaces)
- namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) }
- super
- end
+ private
- # Try fallbacks for the given base.
- def invoke_fallbacks_for(name, base) #:nodoc:
- return nil unless base && fallbacks[base.to_sym]
- invoked_fallbacks = []
+ def print_list(base, namespaces) # :doc:
+ 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 invoke_fallbacks_for(name, base)
+ 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
- end
+ klass = find_by_namespace(name, fallback)
+ return klass if klass
+ end
- def command_type
- @command_type ||= "generator"
- end
+ nil
+ end
- def lookup_paths
- @lookup_paths ||= %w( rails/generators generators )
- end
+ def command_type # :doc:
+ @command_type ||= "generator"
+ end
- def file_lookup_paths
- @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ]
- end
+ def lookup_paths # :doc:
+ @lookup_paths ||= %w( rails/generators generators )
+ end
+
+ def file_lookup_paths # :doc:
+ @file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ]
+ end
end
end
end