summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authordeepj <deepjungle.maca@gmail.com>2015-12-09 17:38:16 +0100
committerdeepj <deepjungle.maca@gmail.com>2015-12-16 01:12:25 +0100
commitf109a129101eb153f329f12c3674f488f72658e1 (patch)
tree55e3392db853137c7d9769439657c057f023ce01 /lib/bundler
parent4592851188b0bcec3dac9b002fca4e80ec3018cf (diff)
downloadbundler-f109a129101eb153f329f12c3674f488f72658e1.tar.gz
Better support of Ruby 2.3 with enabled frozen string literal
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/definition.rb4
-rw-r--r--lib/bundler/env.rb4
-rw-r--r--lib/bundler/gem_helper.rb2
-rw-r--r--lib/bundler/lazy_specification.rb6
-rw-r--r--lib/bundler/resolver.rb2
-rw-r--r--lib/bundler/rubygems_ext.rb4
-rw-r--r--lib/bundler/source/path.rb2
-rw-r--r--lib/bundler/source/rubygems.rb2
8 files changed, 14 insertions, 12 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 7acd78ea0b..f4a4498812 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -53,7 +53,7 @@ module Bundler
@specs = nil
@ruby_version = ruby_version
- @lockfile_contents = ""
+ @lockfile_contents = String.new
@locked_bundler_version = nil
if lockfile && File.exist?(lockfile)
@@ -280,7 +280,7 @@ module Bundler
end
def to_lock
- out = ""
+ out = String.new
sources.lock_sources.each do |source|
# Add the source header
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb
index c6ecdd0f69..be3ca50d52 100644
--- a/lib/bundler/env.rb
+++ b/lib/bundler/env.rb
@@ -11,7 +11,7 @@ module Bundler
print_gemfile = options.delete(:print_gemfile)
print_gemspecs = options.delete(:print_gemspecs)
- out = "Environment\n\n"
+ out = String.new("Environment\n\n")
out << " Bundler #{Bundler::VERSION}\n"
out << " Rubygems #{Gem::VERSION}\n"
out << " Ruby #{ruby_version}"
@@ -62,7 +62,7 @@ module Bundler
end
def ruby_version
- str = "#{RUBY_VERSION}"
+ str = String.new("#{RUBY_VERSION}")
if RUBY_VERSION < "1.9"
str << " (#{RUBY_RELEASE_DATE}"
str << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index 99d4194edf..8cfbeb4df1 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -173,7 +173,7 @@ module Bundler
def sh_with_code(cmd, &block)
cmd << " 2>&1"
- outbuf = ""
+ outbuf = String.new
Bundler.ui.debug(cmd)
SharedHelpers.chdir(base) do
outbuf = `#{cmd}`
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb
index 8d4a114ede..429ebf4868 100644
--- a/lib/bundler/lazy_specification.rb
+++ b/lib/bundler/lazy_specification.rb
@@ -35,10 +35,12 @@ module Bundler
end
def to_lock
+ out = String.new
+
if platform == Gem::Platform::RUBY || platform.nil?
- out = " #{name} (#{version})\n"
+ out << " #{name} (#{version})\n"
else
- out = " #{name} (#{version}-#{platform})\n"
+ out << " #{name} (#{version}-#{platform})\n"
end
dependencies.sort_by(&:to_s).uniq.each do |dep|
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index edced0077f..3a4cb87ac9 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -21,7 +21,7 @@ module Bundler
end
o << %( In Gemfile:\n)
o << conflict.requirement_trees.sort_by {|t| t.reverse.map(&:name) }.map do |tree|
- t = ""
+ t = String.new
depth = 2
tree.each do |req|
t << " " * depth << req.to_s
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 33f6308014..e1051a3851 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -94,7 +94,7 @@ module Gem
private
def dependencies_to_gemfile(dependencies, group = nil)
- gemfile = ""
+ gemfile = String.new
if dependencies.any?
gemfile << "group :#{group} do\n" if group
dependencies.each do |dependency|
@@ -126,7 +126,7 @@ module Gem
end
def to_lock
- out = " #{name}"
+ out = String.new(" #{name}")
unless requirement == Gem::Requirement.default
reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse
out << " (#{reqs.join(", ")})"
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 4192015cb7..ebdab3e813 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -42,7 +42,7 @@ module Bundler
end
def to_lock
- out = "PATH\n"
+ out = String.new("PATH\n")
out << " remote: #{relative_path}\n"
out << " glob: #{@glob}\n" unless @glob == DEFAULT_GLOB
out << " specs:\n"
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index 1f45888421..effd4680f6 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -60,7 +60,7 @@ module Bundler
end
def to_lock
- out = "GEM\n"
+ out = String.new("GEM\n")
remotes.reverse_each do |remote|
out << " remote: #{suppress_configured_credentials remote}\n"
end