summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/installer.rb12
-rw-r--r--man/bundle-init.ronn11
3 files changed, 22 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 6b42fe0fb5..a50806ba4b 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -175,7 +175,7 @@ module Bundler
raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
"be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
"that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
- "to a different version of #{locked_gem} that hasn't been removed in order to install."
+ "to a version other than #{locked_gem} that hasn't been removed in order to install."
end
unless specs["bundler"].any?
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 5082a6bffe..1b9fef1e39 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -135,7 +135,11 @@ module Bundler
end
File.open(binstub_path, "w", 0o777 & ~File.umask) do |f|
- f.puts ERB.new(template, nil, "-").result(binding)
+ if RUBY_VERSION >= "2.6"
+ f.puts ERB.new(template, :trim_mode => "-").result(binding)
+ else
+ f.puts ERB.new(template, nil, "-").result(binding)
+ end
end
end
@@ -171,7 +175,11 @@ module Bundler
executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
executable_path = executable_path
File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
- f.puts ERB.new(template, nil, "-").result(binding)
+ if RUBY_VERSION >= "2.6"
+ f.puts ERB.new(template, :trim_mode => "-").result(binding)
+ else
+ f.puts ERB.new(template, nil, "-").result(binding)
+ end
end
end
end
diff --git a/man/bundle-init.ronn b/man/bundle-init.ronn
index 781a25b1a2..7504af7bab 100644
--- a/man/bundle-init.ronn
+++ b/man/bundle-init.ronn
@@ -16,3 +16,14 @@ created [`Gemfile(5)`][Gemfile(5)].
* `--gemspec`:
Use the specified .gemspec to create the [`Gemfile(5)`][Gemfile(5)]
+
+## FILES
+
+Included in the default [`Gemfile(5)`][Gemfile(5)]
+generated is the line `# frozen_string_literal: true`. This is a magic comment
+supported for the first time in Ruby 2.3. The presence of this line
+results in all string literals in the file being implicitly frozen.
+
+## SEE ALSO
+
+[Gemfile(5)](http://bundler.io/man/gemfile.5.html)