This PR removes a number of `require` calls that are unnecessary or discouraged.
In general, it's discouraged to call `require` from within `app/` as it can interfere with the autoloader. These are the individual rationales for each `require`: - `timeout`: already required by ActiveRecord, but added to the gemfile to be explicit. - `rexml/document`: required by default by `rexml`, added to the gemfile to be explicit. - `ostruct`: not being used any more. - `uri`: loaded as a gem. - `xml/libxml`: required automatically by `libxml-ruby`. - `rtlcss`: loaded as a gem. - `open3`: loaded as a gem. - `digest`: already required by... Bundler I think, but added to the gemfile to be explicit - `addressable/uri`: required by default by `addressable` Note that some gems like `timeout` are "standard gems" which are present in Ruby by default but are also offered as separate gems (see https://stdgems.org/). The point here is that I think it's better to add them to the gemfile to be explicit, which also avoids these discouraged `require`s. Additionally, there's no need to add `:require => "libxml"` to the gem `libxml-ruby` as that happens automatically too. You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/6461 -- Commit Summary -- * Remove unnecessary requires; use gems when possible * No need as that's the default behaviour -- File Changes -- M Gemfile (14) M Gemfile.lock (6) M app/controllers/application_controller.rb (2) M app/helpers/application_helper.rb (2) M app/helpers/open_graph_helper.rb (2) M app/helpers/reports_helper.rb (2) M app/helpers/share_buttons_helper.rb (2) M app/models/changeset.rb (2) M app/models/node.rb (2) M app/models/relation.rb (2) M app/models/trace.rb (2) M app/models/user.rb (1) M app/models/way.rb (2) M config/initializers/rtlcss.rb (2) M lib/nominatim.rb (2) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/6461.patch https://github.com/openstreetmap/openstreetmap-website/pull/6461.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6461 You are receiving this because you are subscribed to this thread. Message ID: <openstreetmap/openstreetmap-website/pull/[email protected]>
_______________________________________________ rails-dev mailing list [email protected] https://lists.openstreetmap.org/listinfo/rails-dev
