From: shevegen@... Date: 2017-04-28T18:57:00+00:00 Subject: [ruby-core:80928] [Ruby trunk Feature#13516] Improve the text of the circular require warning Issue #13516 has been updated by shevegen (Robert A. Heiler). I am not sure if this particular message is better or not - but I agree with you in general. To me this was a source of frustration for a long time transitioning from ruby 1.8.x to a higher ruby version, until I started to change the way how I write ruby code. Nowadays I usually start with the smallest, standalone base .rb file and then build from there to avoid the circular requires. I still would love to see some kind of better abstraction system for loading ruby code though, so I am all up for all suggestions that try to improve that warning or the overall situation here. PS: Actually on second thought, the new message confuses me too. ;) May it actually be possible to also show some ascii message or something that pinpoints to the problematic file at hand? Like: foobar.rb barfoo.rb -> bar/foo.rb With the warning showing that foo.rb is required by both foobar.rb and barfoo.rb and additionally requires barfoo.rb (and barfoo.rb also showing foo.rb). I guess ruby can not be sure as to which file is the troublemaker but it could give some listing as to which files exactly could be problematic, most likely. Some reporting that is a bit similar as to how the "did_you_mean" gem indicates a possible error or typo. the above situation, foobar.rb ---------------------------------------- Feature #13516: Improve the text of the circular require warning https://bugs.ruby-lang.org/issues/13516#change-64563 * Author: jaredbeck (Jared Beck) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- The warning currently reads: `loading in progress, circular require considered harmful - /my/file.rb` I think it would be more helpful like: `Circular require: Loading of /my/file.rb is already in progress, but require was called again` I think this is more helpful because it clarifies that /my/file.rb is the problem. What do you think? Thanks! -- https://bugs.ruby-lang.org/ Unsubscribe: