Skip to content

Commit

Permalink
Merge pull request #4011 from rubygems/lazily_load_erb
Browse files Browse the repository at this point in the history
Lazily load `erb`

(cherry picked from commit 5d32586)
  • Loading branch information
deivid-rodriguez committed Dec 7, 2020
1 parent 485650b commit 35fef29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bundler/lib/bundler/installer.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "erb"
require "rubygems/dependency_installer"
require_relative "worker"
require_relative "installer/parallel_installer"
Expand Down Expand Up @@ -136,6 +135,7 @@ def generate_bundler_executable_stubs(spec, options = {})
end

mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
require "erb"
content = if RUBY_VERSION >= "2.6"
ERB.new(template, :trim_mode => "-").result(binding)
else
Expand Down Expand Up @@ -182,6 +182,7 @@ def generate_standalone_bundler_executable_stubs(spec)
executable_path = executable_path

mode = Bundler::WINDOWS ? "wb:UTF-8" : "w"
require "erb"
content = if RUBY_VERSION >= "2.6"
ERB.new(template, :trim_mode => "-").result(binding)
else
Expand Down

0 comments on commit 35fef29

Please sign in to comment.