diff options
author | Akira Matsuda <ronnie@dio.jp> | 2016-12-24 23:53:46 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2016-12-25 00:20:38 +0900 |
commit | 87ec7009bfdaad292a18b8bbdc9b25522bb9b1a1 (patch) | |
tree | 8cc41d0395a0e315db6cdd7263dbe050bb811d4b /railties/lib | |
parent | 333af12c00939d11d810e948e950dacf50748eb3 (diff) | |
download | rails-87ec7009bfdaad292a18b8bbdc9b25522bb9b1a1.tar.gz rails-87ec7009bfdaad292a18b8bbdc9b25522bb9b1a1.tar.bz2 rails-87ec7009bfdaad292a18b8bbdc9b25522bb9b1a1.zip |
`protected` here doesn't protect anything
there aren't any instance method defined in this class
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators.rb | 51 |
1 files 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 |