<p dir="auto">This PR removes a number of <code class="notranslate">require</code> calls that are unnecessary or discouraged.</p>
<p dir="auto">In general, it's discouraged to call <code class="notranslate">require</code> from within <code class="notranslate">app/</code> as it can interfere with the autoloader.</p>
<p dir="auto">These are the individual rationales for each <code class="notranslate">require</code>:</p>
<ul dir="auto">
<li><code class="notranslate">timeout</code>: already required by ActiveRecord, but added to the gemfile to be explicit.</li>
<li><code class="notranslate">rexml/document</code>: required by default by <code class="notranslate">rexml</code>, added to the gemfile to be explicit.</li>
<li><code class="notranslate">ostruct</code>: not being used any more.</li>
<li><code class="notranslate">uri</code>: loaded as a gem.</li>
<li><code class="notranslate">xml/libxml</code>: required automatically by <code class="notranslate">libxml-ruby</code>.</li>
<li><code class="notranslate">rtlcss</code>: loaded as a gem.</li>
<li><code class="notranslate">open3</code>: loaded as a gem.</li>
<li><code class="notranslate">digest</code>: already required by... Bundler I think, but added to the gemfile to be explicit</li>
<li><code class="notranslate">addressable/uri</code>: required by default by <code class="notranslate">addressable</code></li>
</ul>
<p dir="auto">Note that some gems like <code class="notranslate">timeout</code> are "standard gems" which are present in Ruby by default but are also offered as separate gems (see <a href="https://stdgems.org/" rel="nofollow">https://stdgems.org/</a>). The point here is that I think it's better to add them to the gemfile to be explicit, which also avoids these discouraged <code class="notranslate">require</code>s.</p>
<p dir="auto">Additionally, there's no need to add <code class="notranslate">:require => "libxml"</code> to the gem <code class="notranslate">libxml-ruby</code> as that happens automatically too.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/6461'>https://github.com/openstreetmap/openstreetmap-website/pull/6461</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/commits/7ad6bb1ee6eca4514ba1118bb5c1828ce93c561e" class="commit-link">7ad6bb1</a> Remove unnecessary requires; use gems when possible</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/commits/af7887180617cf871040ae53b0f9de5de540861b" class="commit-link">af78871</a> No need as that's the default behaviour</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files">15 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-d09ea66f8227784ff4393d88a19836f321c915ae10031d16c93d67e6283ab55f">Gemfile</a>
(14)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-89cade48462044ee1b672dc5f4c3ec250fbd29effcd8932096a23c1283c6731f">Gemfile.lock</a>
(6)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-766c34fd6533171eaf54300c153f89d6002c35c02cfc9c5b219251f85180ad07">app/controllers/application_controller.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-5f3fc5e3977d242572aa1d08551f5eb557de0ccaff30370838ee9df5386ea0da">app/helpers/application_helper.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-3b130313f33af70814d5335654e0d36dd7225fde4555e9db4aeb59daf7da6924">app/helpers/open_graph_helper.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-13587849518ac88fc4da1480f827b4517abe06be9dbafd8075c8f9ed48340c4b">app/helpers/reports_helper.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-88ee9f811768fc1e00cfc392d4f10caad64059a7e9a1da6b5a53a4d2d1408c39">app/helpers/share_buttons_helper.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-33e24e983f7ae5829e0e919c3843ccaaa05be35610607ec2fd486636d2c14e56">app/models/changeset.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-d521fcf96c3de2b8c810e0e8da2c12824cd1de1a7999f8b600284e8f358703c1">app/models/node.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-bd34d574a6519bf199e087e2c1cb091c789c2a9e76b22ab8b454ddfc43e1fdd0">app/models/relation.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-49ff8e13eb2bff9ffd834dad7421f568b40186cb58b28e7eac6b3e9168ec8759">app/models/trace.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-9802ca3c9c4cf89904fd44bc114e35ebdf2c5dd3d5b645491e2b253e1afef29b">app/models/user.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-bedc4e8b2c0975fdcb8401541fbed87e09c8cc55e265cf7802fba772e6b5aaf7">app/models/way.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-943d118e6d3def88bfb4eda0f381aa3bf5b953c816ed580ebe26d3b35992c638">config/initializers/rtlcss.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461/files#diff-ccecdda4c0036cffd8604b36dd1df6b0916ebe68d97196c546aac4a3516f0dbb">lib/nominatim.rb</a>
(2)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6461.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/6461.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6461.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/6461.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6461">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOCJYCEMSINT5LLERD3YZQ27AVCNFSM6AAAAACJZ2A7UKVHI2DSMVQWIX3LMV43ASLTON2WKOZTGUZTONBRGM2TSOA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNQIZLO4VNUBL4I5EL3YZQ27A5CNFSM6AAAAACJZ2A7UKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHNFWFF3Y.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6461</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6461",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6461",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>