lib/spring/commands.rb in spring-4.0.0 vs lib/spring/commands.rb in spring-4.1.0

- old
+ new

@@ -26,12 +26,19 @@ # Load custom commands, if any. # needs to be at the end to allow modification of existing commands. config = File.expand_path("~/.spring.rb") require config if File.exist?(config) - # If the config/spring.rb contains requires for commands from other gems, - # then we need to be under bundler. - require "bundler/setup" + # We force the TTY so bundler doesn't show a backtrace in case gems are missing. + old_env = ENV["BUNDLER_FORCE_TTY"] + ENV["BUNDLER_FORCE_TTY"] = "true" + begin + # If the config/spring.rb contains requires for commands from other gems, + # then we need to be under bundler. + require "bundler/setup" + ensure + ENV["BUNDLER_FORCE_TTY"] = old_env + end # Auto-require any Spring extensions which are in the Gemfile Gem::Specification.map(&:name).grep(/^spring-/).each do |command| begin require command