Skip to content

Commit

Permalink
IRB: rescue LoadError on require 'irb/*'
Browse files Browse the repository at this point in the history
Catches bad ruby installations.

#1262
  • Loading branch information
jmoody committed Apr 19, 2017
1 parent 1accc25 commit a5b7fb5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions calabash-cucumber/scripts/.irbrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
require "irb/completion"
require "irb/ext/save-history"
require "benchmark"
begin
require "irb/completion"
require "irb/ext/save-history"
rescue LoadError => e
puts %Q[
Caught a LoadError while requiring an irb module.
#{e}
An error like this usually means your ruby installation is corrupt.
]
exit(1)
end

begin
require "awesome_print"
Expand All @@ -25,6 +36,8 @@ $ gem install calabash-cucumber
exit(1)
end

require "benchmark"

AwesomePrint.irb!

ARGV.concat ["--readline", "--prompt-mode", "simple"]
Expand Down

0 comments on commit a5b7fb5

Please sign in to comment.