180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
# File 'lib/betterdocs/global.rb', line 180
def all_docs
Dir.chdir controllers_dir do
Dir["#{api_prefix}/**/*_controller.rb"].each_with_object([]) do |cf, all|
controller_name = cf.sub(/\.rb$/, '').camelcase
controller =
begin
controller_name.constantize
rescue NameError => e
STDERR.puts "Skipping #{cf.inspect}, #{e.class}: #{e}"
next
end
if docs = controller.ask_and_send(:docs)
all << docs
else
STDERR.puts "Skipping #{cf.inspect}, #{controller_name.inspect} doesn't respond to :docs method"
end
end
end
end
|