Take the sample ruby code, how to rewrite/indent it so the following ruby code to make it more readable & make sure it fits in one line i.e 80-90chars?
%w(survey survey_section question_group question dependency dependency_condition answer answer_type answer_validity validation validation_condition validation_prefix validation_precludes error error_type error_level error_code style style_info style_override user user_model_name user_type).each {|m| require m }
Reading it is painful as I have long arrays like this present all over the codebase. it requires LOT of horizontal scrolling & I don’t like that
Any way I can improve this?
The
%wsplits on whitespace, so you can insert newlines whenever you want and get the same result: