diff options
author | Matthias Winkelmann <m@matthi.coffee> | 2018-10-01 11:16:28 +0200 |
---|---|---|
committer | Matthias Winkelmann <m@matthi.coffee> | 2018-10-01 11:16:28 +0200 |
commit | 1feb395903adbd9b0515c4fe8b54afa485640943 (patch) | |
tree | 6521034698a22374e4004685e0757cd63582784c | |
parent | 28a56c4a9fac460eb435407674d30d2b473100ea (diff) | |
download | pry-1feb395903adbd9b0515c4fe8b54afa485640943.tar.gz |
Check for existance of cli_options_file before calling realpath()
-rw-r--r-- | lib/pry/plugins.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pry/plugins.rb b/lib/pry/plugins.rb index 525ac712..8e0e9776 100644 --- a/lib/pry/plugins.rb +++ b/lib/pry/plugins.rb @@ -35,8 +35,10 @@ class Pry # Load the Command line options defined by this plugin (if they exist) def load_cli_options cli_options_file = File.join(spec.full_gem_path, "lib/#{spec.name}/cli.rb") + return unless File.exist?(cli_options_file) + cli_options_file = File.realpath(cli_options_file) if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.4.4") - require cli_options_file if File.exist?(cli_options_file) + require cli_options_file end # Activate the plugin (require the gem - enables/loads the # plugin immediately at point of call, even if plugin is |