Skip to content

Commit 6b04905

Browse files
committed
Privatize some methods that were originally protected
1 parent f9caa5a commit 6b04905

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

railties/lib/rails/generators.rb

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -274,38 +274,40 @@ def invoke(namespace, args = ARGV, config = {})
274274
end
275275
end
276276

277-
def print_list(base, namespaces)
278-
namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) }
279-
super
280-
end
277+
private
281278

282-
# Try fallbacks for the given base.
283-
def invoke_fallbacks_for(name, base) #:nodoc:
284-
return nil unless base && fallbacks[base.to_sym]
285-
invoked_fallbacks = []
279+
def print_list(base, namespaces) # :doc:
280+
namespaces = namespaces.reject { |n| hidden_namespaces.include?(n) }
281+
super
282+
end
286283

287-
Array(fallbacks[base.to_sym]).each do |fallback|
288-
next if invoked_fallbacks.include?(fallback)
289-
invoked_fallbacks << fallback
284+
# Try fallbacks for the given base.
285+
def invoke_fallbacks_for(name, base)
286+
return nil unless base && fallbacks[base.to_sym]
287+
invoked_fallbacks = []
290288

291-
klass = find_by_namespace(name, fallback)
292-
return klass if klass
293-
end
289+
Array(fallbacks[base.to_sym]).each do |fallback|
290+
next if invoked_fallbacks.include?(fallback)
291+
invoked_fallbacks << fallback
294292

295-
nil
296-
end
293+
klass = find_by_namespace(name, fallback)
294+
return klass if klass
295+
end
297296

298-
def command_type
299-
@command_type ||= "generator"
300-
end
297+
nil
298+
end
301299

302-
def lookup_paths
303-
@lookup_paths ||= %w( rails/generators generators )
304-
end
300+
def command_type # :doc:
301+
@command_type ||= "generator"
302+
end
305303

306-
def file_lookup_paths
307-
@file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ]
308-
end
304+
def lookup_paths # :doc:
305+
@lookup_paths ||= %w( rails/generators generators )
306+
end
307+
308+
def file_lookup_paths # :doc:
309+
@file_lookup_paths ||= [ "{#{lookup_paths.join(',')}}", "**", "*_generator.rb" ]
310+
end
309311
end
310312
end
311313
end

0 commit comments

Comments
 (0)