Stop ‘require’ing by hand in Ruby

While reading some source code from Sinatra I saw a neat line that made a lot of sense but I’ve never used before:

%w(rubygems rack).each { |req| require req }

Any cons to this approach of reducing the # of lines in our Ruby code? Let me know, otherwise I’ve found a new way to require files and avoid arthritis.

Leave a Reply

Your email address will not be published. Required fields are marked *