summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVít Ondruch <vondruch@redhat.com>2019-12-18 14:29:17 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-12-02 12:46:17 +0900
commit55c9a95ac8ed1a44645cc8d7d80f2e5ebee6ec8f (patch)
treeaa7a3a3e887a495b32e293a8fc92a64f8a1d5695
parent2e601c284c9b61c286aa031d91e5198c17b44f00 (diff)
Don't fail when 'did_you_mean' is not available.
Although 'did_you_mean' is always available in upstream Ruby, it might not be available when speed, memory, disk or network bandwidth is a concern. This is typically the case for production environment, where 'did_you_mean' is of limited usage. Also it might not be available optionally when Ruby is delivered via packaging systems. E.g. Linux distributions.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2764
-rw-r--r--gem_prelude.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/gem_prelude.rb b/gem_prelude.rb
index 1d0158d00a..1c57c943ad 100644
--- a/gem_prelude.rb
+++ b/gem_prelude.rb
@@ -1,2 +1,6 @@
require 'rubygems.rb' if defined?(Gem)
-require 'did_you_mean' if defined?(DidYouMean)
+
+begin
+ require 'did_you_mean'
+rescue LoadError
+end if defined?(DidYouMean)