diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 11:29:09 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:22:06 -0600 |
commit | 7ae072865e3fc23d9844322dde6ad0f6906e3f2c (patch) | |
tree | 2133b2f27e243af2d8beda66f19b2f1086685a0e | |
parent | b1afbe3a2ff7623c9a0e8504bc85af4bd8156059 (diff) | |
download | bundler-7ae072865e3fc23d9844322dde6ad0f6906e3f2c.tar.gz |
Compatibility with frozen string literals
256 files changed, 311 insertions, 54 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index e668c6c9e3..c2ce653729 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -31,6 +31,9 @@ Style/Alias: Style/AlignParameters: EnforcedStyle: with_fixed_indentation +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Style/MultilineBlockChain: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8911c030e3..3ee0c03b15 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -140,15 +140,6 @@ Style/ExtraSpacing: Exclude: - 'lib/bundler/cli.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: when_needed, always -Style/FrozenStringLiteralComment: - Exclude: - - 'lib/bundler/index.rb' - - 'spec/runtime/inline_spec.rb' - # Offense count: 4 # Configuration parameters: AllowedVariables. Style/GlobalVars: @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- +# frozen_string_literal: true $:.unshift File.expand_path("../lib", __FILE__) require "shellwords" require "benchmark" @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "rubygems" @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "rubygems" diff --git a/bin/rubocop b/bin/rubocop index b0a3d74dbd..7460dafaf6 100755 --- a/bin/rubocop +++ b/bin/rubocop @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "rubygems" diff --git a/bundler.gemspec b/bundler.gemspec index 52d5692826..0df67402b2 100644 --- a/bundler.gemspec +++ b/bundler.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 +# frozen_string_literal: true lib = File.expand_path("../lib/", __FILE__) $:.unshift lib unless $:.include?(lib) require "bundler/version" diff --git a/exe/bundle b/exe/bundle index a6068daad3..3fb4ccfce9 100755 --- a/exe/bundle +++ b/exe/bundle @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # Exit cleanly from an early interrupt Signal.trap("INT") { exit 1 } @@ -7,7 +8,8 @@ require "bundler" # Check if an older version of bundler is installed $LOAD_PATH.each do |path| next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9 - err = "Looks like you have a version of bundler that's older than 0.9.\n" + err = String.new + err << "Looks like you have a version of bundler that's older than 0.9.\n" err << "Please remove your old versions.\n" err << "An easy way to do this is by running `gem cleanup bundler`." abort(err) diff --git a/exe/bundle_ruby b/exe/bundle_ruby index 00829265d8..49767304e2 100755 --- a/exe/bundle_ruby +++ b/exe/bundle_ruby @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true Signal.trap("INT") { exit 1 } diff --git a/exe/bundler b/exe/bundler index 5baa52235a..af6c03e12e 100755 --- a/exe/bundler +++ b/exe/bundler @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # Exit cleanly from an early interrupt Signal.trap("INT") { exit 1 } @@ -7,7 +8,8 @@ require "bundler" # Check if an older version of bundler is installed $LOAD_PATH.each do |path| next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9 - err = "Looks like you have a version of bundler that's older than 0.9.\n" + err = String.new + err << "Looks like you have a version of bundler that's older than 0.9.\n" err << "Please remove your old versions.\n" err << "An easy way to do this is by running `gem cleanup bundler`." abort(err) diff --git a/lib/bundler.rb b/lib/bundler.rb index ee2c78ea81..2e7f324002 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "fileutils" require "pathname" require "rbconfig" @@ -385,7 +386,8 @@ module Bundler eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s) rescue ScriptError, StandardError => e original_line = e.backtrace.find {|line| line.include?(path.to_s) } - msg = "There was a #{e.class} while loading #{path.basename}: \n#{e.message}" + msg = String.new + msg << "There was a #{e.class} while loading #{path.basename}: \n#{e.message}" msg << " from\n #{original_line}" if original_line msg << "\n" diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb index 12499c7bf4..2a4954d964 100644 --- a/lib/bundler/capistrano.rb +++ b/lib/bundler/capistrano.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Capistrano task for Bundler. # # Just add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 77eab33ddc..2445172321 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler" require "bundler/vendored_thor" diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb index cf9ce02c4d..8452ca3bfe 100644 --- a/lib/bundler/cli/binstubs.rb +++ b/lib/bundler/cli/binstubs.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/cli/common" module Bundler diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb index 8bc876baea..c8c63e926c 100644 --- a/lib/bundler/cli/cache.rb +++ b/lib/bundler/cli/cache.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Cache attr_reader :options diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index fd09425e4a..f6a1022306 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Check attr_reader :options diff --git a/lib/bundler/cli/clean.rb b/lib/bundler/cli/clean.rb index d70a5b9b89..895b6567fa 100644 --- a/lib/bundler/cli/clean.rb +++ b/lib/bundler/cli/clean.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Clean attr_reader :options diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb index b90544ba3a..491ea04a11 100644 --- a/lib/bundler/cli/common.rb +++ b/lib/bundler/cli/common.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler module CLI::Common def self.without_groups_message diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index ce1be5eb4f..32724f687d 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Config attr_reader :name, :options, :scope, :thor @@ -11,7 +12,7 @@ module Bundler @scope = "global" return unless peek && peek.start_with?("--") @name = args.shift - @scope = $' + @scope = peek[2..-1] end def run diff --git a/lib/bundler/cli/console.rb b/lib/bundler/cli/console.rb index 6e4e1b6686..5e72cdbf0f 100644 --- a/lib/bundler/cli/console.rb +++ b/lib/bundler/cli/console.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Console attr_reader :options, :group diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb index 8b828edf87..4ccc4ba55a 100644 --- a/lib/bundler/cli/exec.rb +++ b/lib/bundler/cli/exec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/current_ruby" module Bundler diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 343a458719..72a1880c52 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "pathname" module Bundler diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 1d201a90f5..4bbdee1f48 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Init attr_reader :options diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb index a17bce036f..e319feb201 100644 --- a/lib/bundler/cli/inject.rb +++ b/lib/bundler/cli/inject.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Inject attr_reader :options, :name, :version, :gems diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 559189b314..0e8599963b 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Install attr_reader :options diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb index 457826dfb5..e95e9ff636 100644 --- a/lib/bundler/cli/lock.rb +++ b/lib/bundler/cli/lock.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Lock attr_reader :options diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb index 0bf42038d9..d4dba703cd 100644 --- a/lib/bundler/cli/open.rb +++ b/lib/bundler/cli/open.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/cli/common" require "shellwords" diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 179635b803..3c85d0bdcd 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/cli/common" module Bundler diff --git a/lib/bundler/cli/package.rb b/lib/bundler/cli/package.rb index de53cb6d8d..cf65e8a68c 100644 --- a/lib/bundler/cli/package.rb +++ b/lib/bundler/cli/package.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Package attr_reader :options diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb index 28641a4c8b..aec08789a9 100644 --- a/lib/bundler/cli/platform.rb +++ b/lib/bundler/cli/platform.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Platform attr_reader :options diff --git a/lib/bundler/cli/show.rb b/lib/bundler/cli/show.rb index 50cf0a97d5..d67b086dd1 100644 --- a/lib/bundler/cli/show.rb +++ b/lib/bundler/cli/show.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/cli/common" module Bundler diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 0102bf0e1a..1a76a88c3d 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Update attr_reader :options, :gems diff --git a/lib/bundler/cli/viz.rb b/lib/bundler/cli/viz.rb index 8fbc64d5fa..7ccd306d63 100644 --- a/lib/bundler/cli/viz.rb +++ b/lib/bundler/cli/viz.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class CLI::Viz attr_reader :options, :gem_name diff --git a/lib/bundler/constants.rb b/lib/bundler/constants.rb index 704bcac84f..5b1c0a8cb1 100644 --- a/lib/bundler/constants.rb +++ b/lib/bundler/constants.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/ FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/ diff --git a/lib/bundler/current_ruby.rb b/lib/bundler/current_ruby.rb index 671171dc37..a7fa2f3a89 100644 --- a/lib/bundler/current_ruby.rb +++ b/lib/bundler/current_ruby.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler # Returns current version of Ruby # diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 636d643a94..d98d8b15b6 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/lockfile_parser" require "digest/sha1" require "set" @@ -347,12 +348,13 @@ module Bundler end def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false) - msg = "You are trying to install in deployment mode after changing\n" \ - "your Gemfile. Run `bundle install` elsewhere and add the\n" \ - "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control." + msg = String.new + msg << "You are trying to install in deployment mode after changing\n" \ + "your Gemfile. Run `bundle install` elsewhere and add the\n" \ + "updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control." unless explicit_flag - msg += "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \ + msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \ "freeze \nby running `bundle install --no-deployment`." end diff --git a/lib/bundler/dep_proxy.rb b/lib/bundler/dep_proxy.rb index 4efd99c9bb..998975bbaf 100644 --- a/lib/bundler/dep_proxy.rb +++ b/lib/bundler/dep_proxy.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class DepProxy attr_reader :__platform, :dep diff --git a/lib/bundler/dependency.rb b/lib/bundler/dependency.rb index a62808d23c..1b1808b40a 100644 --- a/lib/bundler/dependency.rb +++ b/lib/bundler/dependency.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems/dependency" require "bundler/shared_helpers" require "bundler/rubygems_ext" diff --git a/lib/bundler/deployment.rb b/lib/bundler/deployment.rb index 163f61eabb..23968e7084 100644 --- a/lib/bundler/deployment.rb +++ b/lib/bundler/deployment.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Deployment def self.define_task(context, task_method = :task, opts = {}) diff --git a/lib/bundler/deprecate.rb b/lib/bundler/deprecate.rb index 02eb4b0918..1ab4de1a28 100644 --- a/lib/bundler/deprecate.rb +++ b/lib/bundler/deprecate.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler if defined? ::Deprecate Deprecate = ::Deprecate diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 8a3931e852..b3b6bfdcce 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/dependency" require "bundler/ruby_dsl" @@ -345,7 +346,8 @@ module Bundler def validate_keys(command, opts, valid_keys) invalid_keys = opts.keys - valid_keys if invalid_keys.any? - message = "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} " + message = String.new + message << "You passed #{invalid_keys.map {|k| ":" + k }.join(", ")} " message << if invalid_keys.size > 1 "as options for #{command}, but they are invalid." else @@ -450,7 +452,7 @@ module Bundler @to_s ||= begin trace_line, description = parse_line_number_from_description - m = "\n[!] " + m = String.new("\n[!] ") m << description m << ". Bundler cannot continue.\n" diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index 93d35900ae..baf6a10f31 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/rubygems_integration" require "bundler/source/git/git_proxy" diff --git a/lib/bundler/environment.rb b/lib/bundler/environment.rb index 0e4ed37814..4e072602e6 100644 --- a/lib/bundler/environment.rb +++ b/lib/bundler/environment.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Environment attr_reader :root diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb index 9fc7b6df7b..eec8d00ef5 100644 --- a/lib/bundler/errors.rb +++ b/lib/bundler/errors.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class BundlerError < StandardError def self.status_code(code) diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index 63f61070e3..348c29dcbe 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/vendored_persistent" require "cgi" require "securerandom" @@ -53,15 +54,17 @@ module Bundler # Exceptions classes that should bypass retry attempts. If your password didn't work the # first time, it's not going to the third time. - FAIL_ERRORS = [AuthenticationRequiredError, BadAuthenticationError, FallbackError].freeze NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency, :HTTPForbidden, :HTTPInsufficientStorage, :HTTPMethodNotAllowed, :HTTPMovedPermanently, :HTTPNoContent, :HTTPNotFound, :HTTPNotImplemented, :HTTPPreconditionFailed, :HTTPRequestEntityTooLarge, :HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity, :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze - FAIL_ERRORS << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError) - FAIL_ERRORS.push(*NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact) + FAIL_ERRORS = begin + fail_errors = [AuthenticationRequiredError, BadAuthenticationError, FallbackError] + fail_errors << Gem::Requirement::BadRequirementError if defined?(Gem::Requirement::BadRequirementError) + fail_errors.push(*NET_ERRORS.map {|e| SharedHelpers.const_get_safely(e, Net) }.compact) + end.freeze class << self attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries @@ -161,7 +164,7 @@ module Bundler @user_agent ||= begin ruby = Bundler::RubyVersion.system - agent = "bundler/#{Bundler::VERSION}" + agent = String.new("bundler/#{Bundler::VERSION}") agent << " rubygems/#{Gem::VERSION}" agent << " ruby/#{ruby.version}" agent << " (#{ruby.host})" diff --git a/lib/bundler/fetcher/base.rb b/lib/bundler/fetcher/base.rb index 1d1adc73db..f7210bd03d 100644 --- a/lib/bundler/fetcher/base.rb +++ b/lib/bundler/fetcher/base.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Fetcher class Base diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 0dd9b130be..f249ec1835 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/fetcher/base" require "bundler/worker" diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb index fdf91c1710..274b34eefd 100644 --- a/lib/bundler/fetcher/dependency.rb +++ b/lib/bundler/fetcher/dependency.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/fetcher/base" require "cgi" diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb index 9d8d783c8a..204e33387e 100644 --- a/lib/bundler/fetcher/downloader.rb +++ b/lib/bundler/fetcher/downloader.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Fetcher class Downloader diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb index f23811c8c5..d8e212989e 100644 --- a/lib/bundler/fetcher/index.rb +++ b/lib/bundler/fetcher/index.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/fetcher/base" require "rubygems/remote_fetcher" diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb index fd98bf55e1..b453e8e625 100644 --- a/lib/bundler/friendly_errors.rb +++ b/lib/bundler/friendly_errors.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true require "cgi" require "bundler/vendored_thor" @@ -68,7 +69,7 @@ module Bundler Error details #{e.class}: #{e.message} - #{e.backtrace.join("\n ")} + #{e.backtrace.join("\n ")} #{Bundler::Env.new.report(:print_gemfile => false, :print_gemspecs => false).gsub(/\n/, "\n ").strip} --- TEMPLATE END ---------------------------------------------------------------- diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index 30822148b4..41c574bfd2 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/vendored_thor" unless defined?(Thor) require "bundler" @@ -98,7 +99,7 @@ module Bundler gem_command = "gem push '#{path}'" if @gemspec.respond_to?(:metadata) allowed_push_host = @gemspec.metadata["allowed_push_host"] - gem_command << " --host #{allowed_push_host}" if allowed_push_host + gem_command += " --host #{allowed_push_host}" if allowed_push_host end sh(gem_command) Bundler.ui.confirm "Pushed #{name} #{version} to #{allowed_push_host ? allowed_push_host : "rubygems.org."}" @@ -169,14 +170,15 @@ module Bundler end def sh_with_code(cmd, &block) - cmd << " 2>&1" + cmd += " 2>&1" outbuf = String.new Bundler.ui.debug(cmd) SharedHelpers.chdir(base) do outbuf = `#{cmd}` - block.call(outbuf) if $? == 0 && block + status = $?.exitstatus + block.call(outbuf) if status.zero? && block + [outbuf, status] end - [outbuf, $?] end def gem_push? diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb index 6e43caef1a..5c824ffefc 100644 --- a/lib/bundler/gem_helpers.rb +++ b/lib/bundler/gem_helpers.rb @@ -1,6 +1,7 @@ +# frozen_string_literal: true module Bundler module GemHelpers - GENERIC_CACHE = {}.freeze + GENERIC_CACHE = {} # rubocop:disable MutableConstant GENERICS = [ [Gem::Platform.new("java"), Gem::Platform.new("java")], [Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")], diff --git a/lib/bundler/gem_remote_fetcher.rb b/lib/bundler/gem_remote_fetcher.rb index 8a823da963..481838a5e2 100644 --- a/lib/bundler/gem_remote_fetcher.rb +++ b/lib/bundler/gem_remote_fetcher.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems/remote_fetcher" module Bundler diff --git a/lib/bundler/gem_tasks.rb b/lib/bundler/gem_tasks.rb index 0ff383bf8b..230e7f28f2 100644 --- a/lib/bundler/gem_tasks.rb +++ b/lib/bundler/gem_tasks.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rake/clean" CLOBBER.include "pkg" diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb index 61c47380ac..c7e957ad7a 100644 --- a/lib/bundler/graph.rb +++ b/lib/bundler/graph.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "set" module Bundler class Graph diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index 40ae97d5bd..f2defe1cff 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "set" module Bundler diff --git a/lib/bundler/injector.rb b/lib/bundler/injector.rb index ef98fad888..c27e2499ca 100644 --- a/lib/bundler/injector.rb +++ b/lib/bundler/injector.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Injector def self.inject(new_deps) diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index 9df19b02ad..da4afd01bb 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Allows for declaring a Gemfile inline in a ruby script, optionally installing # any gems that aren't already installed on the user's system. # diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 4be5403607..3a54a02151 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "erb" require "rubygems/dependency_installer" require "bundler/worker" diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index f6f865b2ab..441c72108f 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class GemInstaller attr_reader :spec, :standalone, :worker, :force, :installer diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb index 674c45af25..0a276aa9ea 100644 --- a/lib/bundler/installer/parallel_installer.rb +++ b/lib/bundler/installer/parallel_installer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/worker" require "bundler/installer/gem_installer" diff --git a/lib/bundler/installer/standalone.rb b/lib/bundler/installer/standalone.rb index 40100b9540..69cfbfc455 100644 --- a/lib/bundler/installer/standalone.rb +++ b/lib/bundler/installer/standalone.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Standalone def initialize(groups, definition) diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index b3d0d4e732..ccaa791cc8 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "uri" require "rubygems/spec_fetcher" require "bundler/match_platform" diff --git a/lib/bundler/match_platform.rb b/lib/bundler/match_platform.rb index f4b9492c25..fed418b593 100644 --- a/lib/bundler/match_platform.rb +++ b/lib/bundler/match_platform.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/gem_helpers" module Bundler diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb index 45534be035..4978462bb3 100644 --- a/lib/bundler/mirror.rb +++ b/lib/bundler/mirror.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Settings # Class used to build the mirror set and then find a mirror for a given URI diff --git a/lib/bundler/path_preserver.rb b/lib/bundler/path_preserver.rb index c37d7aa087..f5701cd67b 100644 --- a/lib/bundler/path_preserver.rb +++ b/lib/bundler/path_preserver.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler module PathPreserver def self.preserve_path_in_environment(env_var, env) diff --git a/lib/bundler/psyched_yaml.rb b/lib/bundler/psyched_yaml.rb index 429cdb85f2..2c85cb0a53 100644 --- a/lib/bundler/psyched_yaml.rb +++ b/lib/bundler/psyched_yaml.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Psych could be a gem, so try to ask for it begin gem "psych" diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index 2ed4fadadc..29735fc6ab 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "uri" require "rubygems/spec_fetcher" diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index e0a7f186ef..d22ab34e98 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Resolver require "bundler/vendored_molinillo" @@ -12,7 +13,7 @@ module Bundler end def message - conflicts.sort.reduce("") do |o, (name, conflict)| + conflicts.sort.reduce(String.new) do |o, (name, conflict)| o << %(Bundler could not find compatible versions for gem "#{name}":\n) if conflict.locked_requirement o << %( In snapshot (#{Bundler.default_lockfile.basename}):\n) @@ -341,7 +342,7 @@ module Bundler elsif requirement.source name = requirement.name versions = @source_requirements[name][name].map(&:version) - message = "Could not find gem '#{requirement}' in #{requirement.source}.\n" + message = String.new("Could not find gem '#{requirement}' in #{requirement.source}.\n") message << if versions.any? "Source contains '#{name}' at: #{versions.join(", ")}" else diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb index 4b0fff4bd5..bf4d6ab7f7 100644 --- a/lib/bundler/retry.rb +++ b/lib/bundler/retry.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler # General purpose class for retrying code that may fail class Retry diff --git a/lib/bundler/ruby_dsl.rb b/lib/bundler/ruby_dsl.rb index 46587e98cf..47f2bcc337 100644 --- a/lib/bundler/ruby_dsl.rb +++ b/lib/bundler/ruby_dsl.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler module RubyDsl def ruby(ruby_version, options = {}) diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb index 71ed828f71..b8f3b8a863 100644 --- a/lib/bundler/ruby_version.rb +++ b/lib/bundler/ruby_version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class RubyVersion attr_reader :version, :patchlevel, :engine, :engine_version @@ -23,7 +24,7 @@ module Bundler end def to_s - output = "ruby #{version}" + output = String.new("ruby #{version}") output << "p#{patchlevel}" if patchlevel output << " (#{engine} #{engine_version})" unless engine == "ruby" diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index e1051a3851..22c22a2dd0 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "pathname" if defined?(Gem::QuickLoader) @@ -78,7 +79,7 @@ module Gem end def to_gemfile(path = nil) - gemfile = "source 'https://rubygems.org'\n" + gemfile = String.new("source 'https://rubygems.org'\n") gemfile << dependencies_to_gemfile(nondevelopment_dependencies) unless development_dependencies.empty? gemfile << "\n" diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb index 5d7be0cb7e..43637e1e60 100644 --- a/lib/bundler/rubygems_gem_installer.rb +++ b/lib/bundler/rubygems_gem_installer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems/installer" module Bundler diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 5818f5b16a..c8ebe2cb9a 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "monitor" require "rubygems" require "rubygems/config_file" diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index fff8a748af..6ef476b9dc 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "digest/sha1" module Bundler diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 8e0c2282ed..634d9dc14a 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "uri" module Bundler diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index db13967bb1..9aae6478cd 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/shared_helpers" if Bundler::SharedHelpers.in_bundle? diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 75aaf7c8f8..82b80eaa4a 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "pathname" require "rubygems" diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb index 624238552c..e9c1413ea3 100644 --- a/lib/bundler/similarity_detector.rb +++ b/lib/bundler/similarity_detector.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class SimilarityDetector SimilarityScore = Struct.new(:string, :distance) diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb index 0bcf9c3cfe..5f1eb130b7 100644 --- a/lib/bundler/source.rb +++ b/lib/bundler/source.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Source autoload :Rubygems, "bundler/source/rubygems" @@ -17,7 +18,7 @@ module Bundler locked_spec = Bundler.locked_gems.specs.find {|s| s.name == spec.name } locked_spec_version = locked_spec.version if locked_spec if locked_spec_version && spec.version != locked_spec_version - message << " (was #{locked_spec_version})" + message += " (was #{locked_spec_version})" end end diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index b11de1e4bc..90bbd13d34 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "fileutils" require "uri" require "digest/sha1" @@ -35,7 +36,7 @@ module Bundler end def to_lock - out = "GIT\n" + out = String.new("GIT\n") out << " remote: #{@uri}\n" out << " revision: #{revision}\n" %w(ref branch tag submodules).each do |opt| diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index a9f782e8d6..19e0db86fa 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true module Bundler class Source class Git < Path class GitNotInstalledError < GitError def initialize - msg = "You need to install git to be able to use gems from git repositories. " + msg = String.new + msg << "You need to install git to be able to use gems from git repositories. " msg << "For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git" super msg end @@ -11,7 +13,8 @@ module Bundler class GitNotAllowedError < GitError def initialize(command) - msg = "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, " + msg = String.new + msg << "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, " msg << "this error message could probably be more useful. Please submit a ticket at http://github.com/bundler/bundler/issues " msg << "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}" super msg @@ -20,7 +23,8 @@ module Bundler class GitCommandError < GitError def initialize(command, path = nil, extra_info = nil) - msg = "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed." + msg = String.new + msg << "Git error: command `git #{command}` in directory #{SharedHelpers.pwd} has failed." msg << "\n#{extra_info}" if extra_info msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path && path.exist? super msg diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 6f2fe2c1eb..6bfd2e88c7 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -158,7 +158,7 @@ module Bundler end end else - message = "The path `#{expanded_path}` " + message = String.new("The path `#{expanded_path}` ") message << if File.exist?(expanded_path) "is not a directory." else diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb index 74542dd913..0aa27bd564 100644 --- a/lib/bundler/source/path/installer.rb +++ b/lib/bundler/source/path/installer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Source class Path diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 1315677a52..cebb68a700 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "uri" require "rubygems/user_interaction" require "rubygems/spec_fetcher" @@ -118,7 +119,7 @@ module Bundler unless Bundler.settings[:no_install] message = "Installing #{version_message(spec)}" - message << " with native extensions" if spec.extensions.any? + message += " with native extensions" if spec.extensions.any? Bundler.ui.confirm message path = cached_gem(spec) diff --git a/lib/bundler/source/rubygems/remote.rb b/lib/bundler/source/rubygems/remote.rb index 4cd8ea23b8..32265fb600 100644 --- a/lib/bundler/source/rubygems/remote.rb +++ b/lib/bundler/source/rubygems/remote.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class Source class Rubygems diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index c0336bfdd6..dc62c8926a 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler class SourceList attr_reader :path_sources, diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 855a6e3317..5ec546e8e3 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "tsort" require "forwardable" diff --git a/lib/bundler/ssl_certs/certificate_manager.rb b/lib/bundler/ssl_certs/certificate_manager.rb index 558bd9ef50..76639a0cf1 100644 --- a/lib/bundler/ssl_certs/certificate_manager.rb +++ b/lib/bundler/ssl_certs/certificate_manager.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "fileutils" require "net/https" require "openssl" diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index ca5cbe6d9d..f4ee7d0644 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/remote_specification" module Bundler diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable index cc9e06cfec..b72c267dd1 100755 --- a/lib/bundler/templates/Executable +++ b/lib/bundler/templates/Executable @@ -1,4 +1,5 @@ #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %> +# frozen_string_literal: true # # This file was generated by Bundler. # diff --git a/lib/bundler/templates/Gemfile b/lib/bundler/templates/Gemfile index 8d5b66ea29..3f953369c3 100644 --- a/lib/bundler/templates/Gemfile +++ b/lib/bundler/templates/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true # A sample Gemfile source "https://rubygems.org" diff --git a/lib/bundler/ui.rb b/lib/bundler/ui.rb index 7400f80ab1..794c000dc4 100644 --- a/lib/bundler/ui.rb +++ b/lib/bundler/ui.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler module UI autoload :RGProxy, "bundler/ui/rg_proxy" diff --git a/lib/bundler/ui/rg_proxy.rb b/lib/bundler/ui/rg_proxy.rb index 1c9c2deaba..95a1ecdf0c 100644 --- a/lib/bundler/ui/rg_proxy.rb +++ b/lib/bundler/ui/rg_proxy.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/ui" require "rubygems/user_interaction" diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb index 51919a8a5f..425ffae332 100644 --- a/lib/bundler/ui/shell.rb +++ b/lib/bundler/ui/shell.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/vendored_thor" module Bundler diff --git a/lib/bundler/ui/silent.rb b/lib/bundler/ui/silent.rb index 3eb3199b5c..9f387d9e9f 100644 --- a/lib/bundler/ui/silent.rb +++ b/lib/bundler/ui/silent.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler module UI class Silent diff --git a/lib/bundler/vendored_molinillo.rb b/lib/bundler/vendored_molinillo.rb index 795d63a3d3..7b231263cb 100644 --- a/lib/bundler/vendored_molinillo.rb +++ b/lib/bundler/vendored_molinillo.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true module Bundler; end require "bundler/vendor/molinillo/lib/molinillo" diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb index ef404f35d5..d5ae513c59 100644 --- a/lib/bundler/vendored_persistent.rb +++ b/lib/bundler/vendored_persistent.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # We forcibly require OpenSSL, because net/http/persistent will only autoload # it. On some Rubies, autoload fails but explicit require succeeds. begin diff --git a/lib/bundler/vendored_thor.rb b/lib/bundler/vendored_thor.rb index 114483db02..0d0b45bfba 100644 --- a/lib/bundler/vendored_thor.rb +++ b/lib/bundler/vendored_thor.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Bundler; end require "bundler/vendor/thor/lib/thor" require "bundler/vendor/thor/lib/thor/actions" diff --git a/lib/bundler/vlad.rb b/lib/bundler/vlad.rb index 5e20ae6dac..d017ca475a 100644 --- a/lib/bundler/vlad.rb +++ b/lib/bundler/vlad.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Vlad task for Bundler. # # Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and diff --git a/lib/bundler/worker.rb b/lib/bundler/worker.rb index e74823e202..3ef5addcee 100644 --- a/lib/bundler/worker.rb +++ b/lib/bundler/worker.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "thread" module Bundler diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb index 923217da15..9d4353f718 100644 --- a/spec/bundler/bundler_spec.rb +++ b/spec/bundler/bundler_spec.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# frozen_string_literal: true require "spec_helper" require "bundler" diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index a2f87e45fa..b48af7c81a 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/cli" diff --git a/spec/bundler/definition_spec.rb b/spec/bundler/definition_spec.rb index 8dc4bd28f0..443a2c9703 100644 --- a/spec/bundler/definition_spec.rb +++ b/spec/bundler/definition_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/definition" diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 9553c8fd43..77d663d754 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Dsl do diff --git a/spec/bundler/endpoint_specification_spec.rb b/spec/bundler/endpoint_specification_spec.rb index 0340c36261..fccf1842fc 100644 --- a/spec/bundler/endpoint_specification_spec.rb +++ b/spec/bundler/endpoint_specification_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::EndpointSpecification do diff --git a/spec/bundler/env_spec.rb b/spec/bundler/env_spec.rb index 1c38ca87df..305fcce351 100644 --- a/spec/bundler/env_spec.rb +++ b/spec/bundler/env_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/settings" diff --git a/spec/bundler/fetcher/base_spec.rb b/spec/bundler/fetcher/base_spec.rb index 4ca47e4723..5a8c7647b9 100644 --- a/spec/bundler/fetcher/base_spec.rb +++ b/spec/bundler/fetcher/base_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Fetcher::Base do diff --git a/spec/bundler/fetcher/dependency_spec.rb b/spec/bundler/fetcher/dependency_spec.rb index 43c496507e..fd0d5ed9d3 100644 --- a/spec/bundler/fetcher/dependency_spec.rb +++ b/spec/bundler/fetcher/dependency_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Fetcher::Dependency do diff --git a/spec/bundler/fetcher/downloader_spec.rb b/spec/bundler/fetcher/downloader_spec.rb index eade22f441..ebfaf90534 100644 --- a/spec/bundler/fetcher/downloader_spec.rb +++ b/spec/bundler/fetcher/downloader_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Fetcher::Downloader do diff --git a/spec/bundler/fetcher/index_spec.rb b/spec/bundler/fetcher/index_spec.rb index 52acd9cebf..e22dc143ae 100644 --- a/spec/bundler/fetcher/index_spec.rb +++ b/spec/bundler/fetcher/index_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Fetcher::Index do diff --git a/spec/bundler/fetcher_spec.rb b/spec/bundler/fetcher_spec.rb index f1204e7b47..5ebffc42ff 100644 --- a/spec/bundler/fetcher_spec.rb +++ b/spec/bundler/fetcher_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/fetcher" diff --git a/spec/bundler/friendly_errors_spec.rb b/spec/bundler/friendly_errors_spec.rb index e178170967..ae197a4bab 100644 --- a/spec/bundler/friendly_errors_spec.rb +++ b/spec/bundler/friendly_errors_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler" require "bundler/friendly_errors" diff --git a/spec/bundler/gem_helper_spec.rb b/spec/bundler/gem_helper_spec.rb index 7c07a9d215..def926e364 100644 --- a/spec/bundler/gem_helper_spec.rb +++ b/spec/bundler/gem_helper_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "rake" require "bundler/gem_helper" diff --git a/spec/bundler/mirror_spec.rb b/spec/bundler/mirror_spec.rb index 88436fd029..bd6d9bc636 100644 --- a/spec/bundler/mirror_spec.rb +++ b/spec/bundler/mirror_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/mirror" diff --git a/spec/bundler/psyched_yaml_spec.rb b/spec/bundler/psyched_yaml_spec.rb index 2cc7dff842..4b7715b482 100644 --- a/spec/bundler/psyched_yaml_spec.rb +++ b/spec/bundler/psyched_yaml_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/psyched_yaml" diff --git a/spec/bundler/remote_specification_spec.rb b/spec/bundler/remote_specification_spec.rb index 1ff986b9a1..527f48facc 100644 --- a/spec/bundler/remote_specification_spec.rb +++ b/spec/bundler/remote_specification_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::RemoteSpecification do diff --git a/spec/bundler/retry_spec.rb b/spec/bundler/retry_spec.rb index 280ab07d08..cafa099b51 100644 --- a/spec/bundler/retry_spec.rb +++ b/spec/bundler/retry_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Retry do diff --git a/spec/bundler/ruby_version_spec.rb b/spec/bundler/ruby_version_spec.rb index d7ab0105fd..9c9eda04dc 100644 --- a/spec/bundler/ruby_version_spec.rb +++ b/spec/bundler/ruby_version_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/ruby_version" diff --git a/spec/bundler/rubygems_integration_spec.rb b/spec/bundler/rubygems_integration_spec.rb index 84ce709913..917d673b51 100644 --- a/spec/bundler/rubygems_integration_spec.rb +++ b/spec/bundler/rubygems_integration_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::RubygemsIntegration do diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb index 24c71744e1..239f5e6ade 100644 --- a/spec/bundler/settings_spec.rb +++ b/spec/bundler/settings_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/settings" diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb index a72fc34a74..d72a7f49c9 100644 --- a/spec/bundler/shared_helpers_spec.rb +++ b/spec/bundler/shared_helpers_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/shared_helpers" @@ -187,14 +188,14 @@ describe Bundler::SharedHelpers do end it "ensures bundle bin path is in ENV['PATH']" do subject.set_bundle_environment - paths = (ENV["PATH"]).split(File::PATH_SEPARATOR) - expect(paths.include? "#{Bundler.bundle_path}/bin").to eq(true) + paths = ENV["PATH"].split(File::PATH_SEPARATOR) + expect(paths).to include("#{Bundler.bundle_path}/bin") end end shared_examples_for "ENV['RUBYOPT'] gets set correctly" do it "ensures -rbundler/setup is at the beginning of ENV['RUBYOPT']" do subject.set_bundle_environment - expect(ENV["RUBYOPT"].split(" ").first.include? "-rbundler/setup").to eq(true) + expect(ENV["RUBYOPT"].split(" ").first).to include("-rbundler/setup") end end shared_examples_for "ENV['RUBYLIB'] gets set correctly" do diff --git a/spec/bundler/source/git/git_proxy_spec.rb b/spec/bundler/source/git/git_proxy_spec.rb index 7e2083d595..10741b89a7 100644 --- a/spec/bundler/source/git/git_proxy_spec.rb +++ b/spec/bundler/source/git/git_proxy_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Source::Git::GitProxy do diff --git a/spec/bundler/source/rubygems/remote_spec.rb b/spec/bundler/source/rubygems/remote_spec.rb index 599887d47a..a541bf1468 100644 --- a/spec/bundler/source/rubygems/remote_spec.rb +++ b/spec/bundler/source/rubygems/remote_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/source/rubygems/remote" diff --git a/spec/bundler/source/rubygems_spec.rb b/spec/bundler/source/rubygems_spec.rb index 33cb3672dc..9fb4bf0ad3 100644 --- a/spec/bundler/source/rubygems_spec.rb +++ b/spec/bundler/source/rubygems_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Source::Rubygems do diff --git a/spec/bundler/source_list_spec.rb b/spec/bundler/source_list_spec.rb index 3beac46f41..d7567d6e11 100644 --- a/spec/bundler/source_list_spec.rb +++ b/spec/bundler/source_list_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::SourceList do diff --git a/spec/bundler/source_spec.rb b/spec/bundler/source_spec.rb index 5033354ff6..1b4e4bdde9 100644 --- a/spec/bundler/source_spec.rb +++ b/spec/bundler/source_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe Bundler::Source do diff --git a/spec/bundler/ssl_certs/certificate_manager_spec.rb b/spec/bundler/ssl_certs/certificate_manager_spec.rb index 81423ccf90..5a1650b432 100644 --- a/spec/bundler/ssl_certs/certificate_manager_spec.rb +++ b/spec/bundler/ssl_certs/certificate_manager_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/ssl_certs/certificate_manager" diff --git a/spec/cache/cache_path_spec.rb b/spec/cache/cache_path_spec.rb index c0e73ca588..594162886a 100644 --- a/spec/cache/cache_path_spec.rb +++ b/spec/cache/cache_path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle package" do diff --git a/spec/cache/gems_spec.rb b/spec/cache/gems_spec.rb index 9ee5efb32f..a1bb8751dd 100644 --- a/spec/cache/gems_spec.rb +++ b/spec/cache/gems_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle cache" do diff --git a/spec/cache/git_spec.rb b/spec/cache/git_spec.rb index 001cbb4564..f94b1b3469 100644 --- a/spec/cache/git_spec.rb +++ b/spec/cache/git_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "git base name" do diff --git a/spec/cache/path_spec.rb b/spec/cache/path_spec.rb index 82dfce94ba..b81768102a 100644 --- a/spec/cache/path_spec.rb +++ b/spec/cache/path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" %w(cache package).each do |cmd| diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb index 6b73f90f05..e3702aaaf6 100644 --- a/spec/cache/platform_spec.rb +++ b/spec/cache/platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle cache with multiple platforms" do diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb index df5588fcf1..ee319e016c 100644 --- a/spec/commands/binstubs_spec.rb +++ b/spec/commands/binstubs_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle binstubs <gem>" do diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 02e81156ab..9f2053e15b 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle check" do @@ -305,7 +306,7 @@ describe "bundle check" do L if bundler_version - lock << "\n BUNDLED WITH\n #{bundler_version}\n" + lock += "\n BUNDLED WITH\n #{bundler_version}\n" end lock diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb index 9d4c96fc0f..95035555d4 100644 --- a/spec/commands/clean_spec.rb +++ b/spec/commands/clean_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle clean" do diff --git a/spec/commands/config_spec.rb b/spec/commands/config_spec.rb index 33134bef0c..2c31e48940 100644 --- a/spec/commands/config_spec.rb +++ b/spec/commands/config_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe ".bundle/config" do @@ -50,8 +51,8 @@ describe ".bundle/config" do end it "can also be set explicitly" do - bundle "config --global foo global" - run "puts Bundler.settings[:foo]" + bundle! "config --global foo global" + run! "puts Bundler.settings[:foo]" expect(out).to eq("global") end diff --git a/spec/commands/console_spec.rb b/spec/commands/console_spec.rb index 4b1de42e8a..b771c6a940 100644 --- a/spec/commands/console_spec.rb +++ b/spec/commands/console_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle console" do diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 05c1109ee7..ee766cdb5f 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle exec" do diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb index 53c0c0b9a6..704b99a0e8 100644 --- a/spec/commands/help_spec.rb +++ b/spec/commands/help_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle help" do diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb index ef405d121d..70d1143055 100644 --- a/spec/commands/init_spec.rb +++ b/spec/commands/init_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle init" do diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index 4aed64d633..d0112915ca 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle inject" do diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb index fcd8b98dfb..9c81457068 100644 --- a/spec/commands/install_spec.rb +++ b/spec/commands/install_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with gem sources" do diff --git a/spec/commands/licenses_spec.rb b/spec/commands/licenses_spec.rb index 9be0d57838..dd9f261eb3 100644 --- a/spec/commands/licenses_spec.rb +++ b/spec/commands/licenses_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle licenses" do diff --git a/spec/commands/lock_spec.rb b/spec/commands/lock_spec.rb index f1379cc8ca..7f32409ea6 100644 --- a/spec/commands/lock_spec.rb +++ b/spec/commands/lock_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle lock" do diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 732097dacc..c48a1eb4a1 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle gem" do diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb index f443cfe9d3..6fa219f889 100644 --- a/spec/commands/open_spec.rb +++ b/spec/commands/open_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle open" do diff --git a/spec/commands/outdated_spec.rb b/spec/commands/outdated_spec.rb index c0b70c1f11..5db12f0269 100644 --- a/spec/commands/outdated_spec.rb +++ b/spec/commands/outdated_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle outdated" do diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb index f9be542f60..5194ab8051 100644 --- a/spec/commands/package_spec.rb +++ b/spec/commands/package_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle package" do diff --git a/spec/commands/show_spec.rb b/spec/commands/show_spec.rb index 9da787c831..7cfa02d418 100644 --- a/spec/commands/show_spec.rb +++ b/spec/commands/show_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle show" do diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb index 4eadd956f1..31d5a21975 100644 --- a/spec/commands/update_spec.rb +++ b/spec/commands/update_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle update" do diff --git a/spec/commands/viz_spec.rb b/spec/commands/viz_spec.rb index 2052fd273f..c680568899 100644 --- a/spec/commands/viz_spec.rb +++ b/spec/commands/viz_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do diff --git a/spec/install/binstubs_spec.rb b/spec/install/binstubs_spec.rb index 1b34e62567..78865c7f4a 100644 --- a/spec/install/binstubs_spec.rb +++ b/spec/install/binstubs_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index a5278ef2f8..560272e5cf 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 88832f2145..a9a072687c 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "install with --deployment or --frozen" do diff --git a/spec/install/force_spec.rb b/spec/install/force_spec.rb index 2135c4d7b0..9209392d58 100644 --- a/spec/install/force_spec.rb +++ b/spec/install/force_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index 7b38dfb961..36c7353045 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install from an existing gemspec" do diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index c01bf4019a..ecd6462540 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with git sources" do diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb index d64e03186d..2f3f446834 100644 --- a/spec/install/gemfile/groups_spec.rb +++ b/spec/install/gemfile/groups_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with groups" do diff --git a/spec/install/gemfile/install_if.rb b/spec/install/gemfile/install_if.rb index 32b04d1cc4..080a35b989 100644 --- a/spec/install/gemfile/install_if.rb +++ b/spec/install/gemfile/install_if.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with install_if conditionals" do diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index ee45bf3efd..64919370be 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with explicit source paths" do diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index ee7501f759..a562a3bc11 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install across platforms" do diff --git a/spec/install/gemfile/ruby_spec.rb b/spec/install/gemfile/ruby_spec.rb index 9b35e3819c..d3536289eb 100644 --- a/spec/install/gemfile/ruby_spec.rb +++ b/spec/install/gemfile/ruby_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "ruby requirement" do diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index 9ebb2c1ed8..e216340fa5 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with gems on multiple sources" do diff --git a/spec/install/gemfile_spec.rb b/spec/install/gemfile_spec.rb index b1b8a1ac24..a0a1cb9a65 100644 --- a/spec/install/gemfile_spec.rb +++ b/spec/install/gemfile_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb index 1069027a9d..13645f0ae6 100644 --- a/spec/install/gems/compact_index_spec.rb +++ b/spec/install/gems/compact_index_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "compact index api" do diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 55eba01481..70190dd01b 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "gemcutter's dependency API" do diff --git a/spec/install/gems/env_spec.rb b/spec/install/gems/env_spec.rb index ac3d19730a..072e698d8a 100644 --- a/spec/install/gems/env_spec.rb +++ b/spec/install/gems/env_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with ENV conditionals" do diff --git a/spec/install/gems/flex_spec.rb b/spec/install/gems/flex_spec.rb index fe725a5cc8..452cadf35e 100644 --- a/spec/install/gems/flex_spec.rb +++ b/spec/install/gems/flex_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle flex_install" do diff --git a/spec/install/gems/mirror_spec.rb b/spec/install/gems/mirror_spec.rb index 48b97de7bd..8540778d5c 100644 --- a/spec/install/gems/mirror_spec.rb +++ b/spec/install/gems/mirror_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with a mirror configured" do diff --git a/spec/install/gems/native_extensions_spec.rb b/spec/install/gems/native_extensions_spec.rb index 8d14acf5f3..6134663fcc 100644 --- a/spec/install/gems/native_extensions_spec.rb +++ b/spec/install/gems/native_extensions_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "installing a gem with native extensions" do diff --git a/spec/install/gems/post_install_spec.rb b/spec/install/gems/post_install_spec.rb index bea2c9b6ee..596fa6412f 100644 --- a/spec/install/gems/post_install_spec.rb +++ b/spec/install/gems/post_install_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index 5377db233e..49d160063d 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with gem sources" do diff --git a/spec/install/gems/standalone_spec.rb b/spec/install/gems/standalone_spec.rb index ad1f3eda70..4ce5d92eb0 100644 --- a/spec/install/gems/standalone_spec.rb +++ b/spec/install/gems/standalone_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install --standalone" do diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index eaee6d74b2..e102d2da96 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "when using sudo", :sudo => true do diff --git a/spec/install/gems/win32_spec.rb b/spec/install/gems/win32_spec.rb index e75177a0ce..69ea035f5e 100644 --- a/spec/install/gems/win32_spec.rb +++ b/spec/install/gems/win32_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install with win32-generated lockfile" do diff --git a/spec/install/gemspecs_spec.rb b/spec/install/gemspecs_spec.rb index 4300a16cb2..4e2a18679a 100644 --- a/spec/install/gemspecs_spec.rb +++ b/spec/install/gemspecs_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb index 7067ec4466..f3a1983740 100644 --- a/spec/install/git_spec.rb +++ b/spec/install/git_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/parallel/spec_installation_spec.rb b/spec/install/parallel/spec_installation_spec.rb index 6e92bb4cb8..9a8e1cad31 100644 --- a/spec/install/parallel/spec_installation_spec.rb +++ b/spec/install/parallel/spec_installation_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/installer/parallel_installer" diff --git a/spec/install/path_spec.rb b/spec/install/path_spec.rb index ffc53365c3..cf15021727 100644 --- a/spec/install/path_spec.rb +++ b/spec/install/path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/post_bundle_message_spec.rb b/spec/install/post_bundle_message_spec.rb index 39076461db..11fb5bb0a2 100644 --- a/spec/install/post_bundle_message_spec.rb +++ b/spec/install/post_bundle_message_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "post bundle message" do diff --git a/spec/install/prereleases_spec.rb b/spec/install/prereleases_spec.rb index ddbdea3f56..61676f5dfa 100644 --- a/spec/install/prereleases_spec.rb +++ b/spec/install/prereleases_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install" do diff --git a/spec/install/security_policy_spec.rb b/spec/install/security_policy_spec.rb index 288154ad13..08a9213e00 100644 --- a/spec/install/security_policy_spec.rb +++ b/spec/install/security_policy_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "rubygems/security" diff --git a/spec/install/upgrade_spec.rb b/spec/install/upgrade_spec.rb index a57f974bbb..852a746322 100644 --- a/spec/install/upgrade_spec.rb +++ b/spec/install/upgrade_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle install for the first time with v1.0" do diff --git a/spec/lock/git_spec.rb b/spec/lock/git_spec.rb index 8507ae20c0..69937aaba5 100644 --- a/spec/lock/git_spec.rb +++ b/spec/lock/git_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle lock with git gems" do diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index a81eb8a606..6e0713102a 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "the lockfile format" do diff --git a/spec/other/bundle_ruby_spec.rb b/spec/other/bundle_ruby_spec.rb index 37db2490b2..88cd8a7e03 100644 --- a/spec/other/bundle_ruby_spec.rb +++ b/spec/other/bundle_ruby_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle_ruby" do diff --git a/spec/other/cli_dispatch_spec.rb b/spec/other/cli_dispatch_spec.rb index 0dd49c7a40..7aee482bfe 100644 --- a/spec/other/cli_dispatch_spec.rb +++ b/spec/other/cli_dispatch_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle command names" do diff --git a/spec/other/ext_spec.rb b/spec/other/ext_spec.rb index b5b6956106..5508ef8b74 100644 --- a/spec/other/ext_spec.rb +++ b/spec/other/ext_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Gem::Specification#match_platform" do diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index f36cf527ec..7942e604a5 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle platform" do diff --git a/spec/other/ssl_cert_spec.rb b/spec/other/ssl_cert_spec.rb index 1cd22cbb8c..b1b27ebb89 100644 --- a/spec/other/ssl_cert_spec.rb +++ b/spec/other/ssl_cert_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "bundler/ssl_certs/certificate_manager" diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index 4b7cdba1ff..c68bfa1533 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" if defined?(Encoding) && Encoding.default_external.name != "UTF-8" diff --git a/spec/realworld/dependency_api_spec.rb b/spec/realworld/dependency_api_spec.rb index bab5986ea2..c77036fc5f 100644 --- a/spec/realworld/dependency_api_spec.rb +++ b/spec/realworld/dependency_api_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "gemcutter's dependency API", :realworld => true do diff --git a/spec/realworld/edgecases_spec.rb b/spec/realworld/edgecases_spec.rb index fd82c506cf..8295669d19 100644 --- a/spec/realworld/edgecases_spec.rb +++ b/spec/realworld/edgecases_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "real world edgecases", :realworld => true, :sometimes => true do diff --git a/spec/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb index 6c2c05eaa7..be8f45c81b 100644 --- a/spec/realworld/gemfile_source_header_spec.rb +++ b/spec/realworld/gemfile_source_header_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "thread" diff --git a/spec/realworld/mirror_probe_spec.rb b/spec/realworld/mirror_probe_spec.rb index ce64981338..981c4b8442 100644 --- a/spec/realworld/mirror_probe_spec.rb +++ b/spec/realworld/mirror_probe_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" require "thread" diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb index 7154e26dc9..539b8ab287 100644 --- a/spec/realworld/parallel_spec.rb +++ b/spec/realworld/parallel_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "parallel", :realworld => true, :sometimes => true do diff --git a/spec/resolver/basic_spec.rb b/spec/resolver/basic_spec.rb index 0cfaf925da..cb5bc45597 100644 --- a/spec/resolver/basic_spec.rb +++ b/spec/resolver/basic_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Resolving" do diff --git a/spec/resolver/platform_spec.rb b/spec/resolver/platform_spec.rb index 85a0042a26..d5f217684c 100644 --- a/spec/resolver/platform_spec.rb +++ b/spec/resolver/platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Resolving platform craziness" do diff --git a/spec/runtime/executable_spec.rb b/spec/runtime/executable_spec.rb index a0abee27f5..1ce65bd598 100644 --- a/spec/runtime/executable_spec.rb +++ b/spec/runtime/executable_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Running bin/* commands" do diff --git a/spec/runtime/gem_tasks_spec.rb b/spec/runtime/gem_tasks_spec.rb index 1cbc35f7bb..c187efd681 100644 --- a/spec/runtime/gem_tasks_spec.rb +++ b/spec/runtime/gem_tasks_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "require 'bundler/gem_tasks'" do diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index a5142d34ed..7d74e8cd14 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundler/inline#gemfile" do @@ -5,7 +6,7 @@ describe "bundler/inline#gemfile" do requires = ["bundler/inline"] requires.unshift File.expand_path("../../support/artifice/" + options.delete(:artifice) + ".rb", __FILE__) if options.key?(:artifice) requires = requires.map {|r| "require '#{r}'" }.join("\n") - @out = ruby("#{requires}\n\n" << code, options) + @out = ruby("#{requires}\n\n" + code, options) end before :each do diff --git a/spec/runtime/load_spec.rb b/spec/runtime/load_spec.rb index b7c856ac3a..c010f8f8e9 100644 --- a/spec/runtime/load_spec.rb +++ b/spec/runtime/load_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Bundler.load" do diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb index cbc12ef495..db99f3556b 100644 --- a/spec/runtime/platform_spec.rb +++ b/spec/runtime/platform_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Bundler.setup with multi platform stuff" do diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index e227514838..fbfa398239 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/runtime/require_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Bundler.require" do diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 37c1a2d9a2..be3d1baf2b 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Bundler.setup" do @@ -915,7 +916,7 @@ describe "Bundler.setup" do L if bundler_version - lock << "\n BUNDLED WITH\n #{bundler_version}\n" + lock += "\n BUNDLED WITH\n #{bundler_version}\n" end lock diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb index 55c6ed98ed..92607efc76 100644 --- a/spec/runtime/with_clean_env_spec.rb +++ b/spec/runtime/with_clean_env_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "Bundler.with_env helpers" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cd2dc39469..bea836aae6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true $:.unshift File.expand_path("..", __FILE__) $:.unshift File.expand_path("../../lib", __FILE__) diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb index eb17f01905..88706c3590 100644 --- a/spec/support/artifice/compact_index.rb +++ b/spec/support/artifice/compact_index.rb @@ -48,7 +48,7 @@ class CompactIndexAPI < Endpoint end def quote(string) - '"' << string << '"' + %("#{string}") end def parse_etags(value) diff --git a/spec/support/artifice/compact_index_api_missing.rb b/spec/support/artifice/compact_index_api_missing.rb index db6528b878..6d15b54b85 100644 --- a/spec/support/artifice/compact_index_api_missing.rb +++ b/spec/support/artifice/compact_index_api_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_basic_authentication.rb b/spec/support/artifice/compact_index_basic_authentication.rb index 5ddcdf7fa7..bffb5b9e2b 100644 --- a/spec/support/artifice/compact_index_basic_authentication.rb +++ b/spec/support/artifice/compact_index_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_creds_diff_host.rb b/spec/support/artifice/compact_index_creds_diff_host.rb index 2e8cd46b5e..0c417f0580 100644 --- a/spec/support/artifice/compact_index_creds_diff_host.rb +++ b/spec/support/artifice/compact_index_creds_diff_host.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra.rb b/spec/support/artifice/compact_index_extra.rb index 3300b70610..8a87fc4343 100644 --- a/spec/support/artifice/compact_index_extra.rb +++ b/spec/support/artifice/compact_index_extra.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_api.rb b/spec/support/artifice/compact_index_extra_api.rb index df4674396a..063e5589d4 100644 --- a/spec/support/artifice/compact_index_extra_api.rb +++ b/spec/support/artifice/compact_index_extra_api.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_missing.rb b/spec/support/artifice/compact_index_extra_missing.rb index 48fffd51a8..2af5ce9c27 100644 --- a/spec/support/artifice/compact_index_extra_missing.rb +++ b/spec/support/artifice/compact_index_extra_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index_extra", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_forbidden.rb b/spec/support/artifice/compact_index_forbidden.rb index 09d03bc88d..b25eea94e7 100644 --- a/spec/support/artifice/compact_index_forbidden.rb +++ b/spec/support/artifice/compact_index_forbidden.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_host_redirect.rb b/spec/support/artifice/compact_index_host_redirect.rb index 2e53cc7814..6c1ab2def6 100644 --- a/spec/support/artifice/compact_index_host_redirect.rb +++ b/spec/support/artifice/compact_index_host_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_redirects.rb b/spec/support/artifice/compact_index_redirects.rb index 256e73d7f4..ff1d3e43bc 100644 --- a/spec/support/artifice/compact_index_redirects.rb +++ b/spec/support/artifice/compact_index_redirects.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/compact_index_strict_basic_authentication.rb b/spec/support/artifice/compact_index_strict_basic_authentication.rb index bb1e794b4e..49a072d2b9 100644 --- a/spec/support/artifice/compact_index_strict_basic_authentication.rb +++ b/spec/support/artifice/compact_index_strict_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../compact_index", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb index 205b25885a..f1f8dc5700 100644 --- a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +++ b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_marshal_fail", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb index 847f1d4b23..b0e9bd0f26 100644 --- a/spec/support/artifice/endpoint.rb +++ b/spec/support/artifice/endpoint.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) require File.expand_path("../../../../lib/bundler/deprecate", __FILE__) include Spec::Path diff --git a/spec/support/artifice/endpoint_500.rb b/spec/support/artifice/endpoint_500.rb index 2812a0d208..9bbbd1e2f2 100644 --- a/spec/support/artifice/endpoint_500.rb +++ b/spec/support/artifice/endpoint_500.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) include Spec::Path diff --git a/spec/support/artifice/endpoint_api_forbidden.rb b/spec/support/artifice/endpoint_api_forbidden.rb index f9d28c0470..21ad9117ed 100644 --- a/spec/support/artifice/endpoint_api_forbidden.rb +++ b/spec/support/artifice/endpoint_api_forbidden.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_api_missing.rb b/spec/support/artifice/endpoint_api_missing.rb index ca5916938f..6f5b5f1323 100644 --- a/spec/support/artifice/endpoint_api_missing.rb +++ b/spec/support/artifice/endpoint_api_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_basic_authentication.rb b/spec/support/artifice/endpoint_basic_authentication.rb index 0cfba89184..9fafd51a3d 100644 --- a/spec/support/artifice/endpoint_basic_authentication.rb +++ b/spec/support/artifice/endpoint_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb index 97a81d97d8..cd152848fe 100644 --- a/spec/support/artifice/endpoint_creds_diff_host.rb +++ b/spec/support/artifice/endpoint_creds_diff_host.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra.rb b/spec/support/artifice/endpoint_extra.rb index c50428fe20..ed4e87e65f 100644 --- a/spec/support/artifice/endpoint_extra.rb +++ b/spec/support/artifice/endpoint_extra.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_api.rb b/spec/support/artifice/endpoint_extra_api.rb index d6d1c5a1b4..1e9e1dc60d 100644 --- a/spec/support/artifice/endpoint_extra_api.rb +++ b/spec/support/artifice/endpoint_extra_api.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_missing.rb b/spec/support/artifice/endpoint_extra_missing.rb index 89c4c0c776..dc79705a26 100644 --- a/spec/support/artifice/endpoint_extra_missing.rb +++ b/spec/support/artifice/endpoint_extra_missing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_extra", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_fallback.rb b/spec/support/artifice/endpoint_fallback.rb index db02a88758..8a85a41784 100644 --- a/spec/support/artifice/endpoint_fallback.rb +++ b/spec/support/artifice/endpoint_fallback.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_host_redirect.rb b/spec/support/artifice/endpoint_host_redirect.rb index 00c496af58..250416d8cc 100644 --- a/spec/support/artifice/endpoint_host_redirect.rb +++ b/spec/support/artifice/endpoint_host_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_marshal_fail.rb b/spec/support/artifice/endpoint_marshal_fail.rb index a0dc182e27..0fb75ebf31 100644 --- a/spec/support/artifice/endpoint_marshal_fail.rb +++ b/spec/support/artifice/endpoint_marshal_fail.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_fallback", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_mirror_source.rb b/spec/support/artifice/endpoint_mirror_source.rb index 39cd3656fa..9fb58ecb29 100644 --- a/spec/support/artifice/endpoint_mirror_source.rb +++ b/spec/support/artifice/endpoint_mirror_source.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) class EndpointMirrorSource < Endpoint diff --git a/spec/support/artifice/endpoint_redirect.rb b/spec/support/artifice/endpoint_redirect.rb index 2b48fa5344..f80d7600c2 100644 --- a/spec/support/artifice/endpoint_redirect.rb +++ b/spec/support/artifice/endpoint_redirect.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_strict_basic_authentication.rb b/spec/support/artifice/endpoint_strict_basic_authentication.rb index e7329abdc4..4b32cbbf5b 100644 --- a/spec/support/artifice/endpoint_strict_basic_authentication.rb +++ b/spec/support/artifice/endpoint_strict_basic_authentication.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint", __FILE__) Artifice.deactivate diff --git a/spec/support/artifice/endpoint_timeout.rb b/spec/support/artifice/endpoint_timeout.rb index da682204c4..b15650f226 100644 --- a/spec/support/artifice/endpoint_timeout.rb +++ b/spec/support/artifice/endpoint_timeout.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../endpoint_fallback", __FILE__) Artifice.deactivate diff --git a/spec/support/builders.rb b/spec/support/builders.rb index 4f5dace604..3a18cbea77 100644 --- a/spec/support/builders.rb +++ b/spec/support/builders.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "bundler/shared_helpers" module Spec @@ -624,7 +625,7 @@ module Spec current_ref = `git rev-parse HEAD`.strip _default_files.keys.each do |path| - _default_files[path] << "\n#{Builders.constantize(name)}_PREV_REF = '#{current_ref}'" + _default_files[path] += "\n#{Builders.constantize(name)}_PREV_REF = '#{current_ref}'" end super(options.merge(:path => libpath, :gemspec => false)) `git add *` diff --git a/spec/support/code_climate.rb b/spec/support/code_climate.rb index cfcd890a40..8f1fb35bcd 100644 --- a/spec/support/code_climate.rb +++ b/spec/support/code_climate.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module CodeClimate def self.setup diff --git a/spec/support/fakeweb/windows.rb b/spec/support/fakeweb/windows.rb index 6c674b31b6..f1f21eed3f 100644 --- a/spec/support/fakeweb/windows.rb +++ b/spec/support/fakeweb/windows.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require File.expand_path("../../path.rb", __FILE__) include Spec::Path diff --git a/spec/support/hax.rb b/spec/support/hax.rb index 1fd3ae9936..2cca22c6ab 100644 --- a/spec/support/hax.rb +++ b/spec/support/hax.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems" class Gem::Platform diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 8aade71af9..8bcae2a45a 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Helpers def reset! @@ -122,7 +123,7 @@ module Spec def ruby(ruby, options = {}) expect_err = options.delete(:expect_err) env = (options.delete(:env) || {}).map {|k, v| "#{k}='#{v}' " }.join - ruby.gsub!(/["`\$]/) {|m| "\\#{m}" } + ruby = ruby.gsub(/["`\$]/) {|m| "\\#{m}" } lib_option = options[:no_lib] ? "" : " -I#{lib}" sys_exec(%(#{env}#{Gem.ruby}#{lib_option} -e "#{ruby}"), expect_err) end diff --git a/spec/support/indexes.rb b/spec/support/indexes.rb index 10067197db..acace96886 100644 --- a/spec/support/indexes.rb +++ b/spec/support/indexes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Indexes def dep(name, reqs = nil) diff --git a/spec/support/less_than_proc.rb b/spec/support/less_than_proc.rb index 515470968a..27966aa6ed 100644 --- a/spec/support/less_than_proc.rb +++ b/spec/support/less_than_proc.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class LessThanProc < Proc attr_accessor :present diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index 58babf2ceb..7047e1be76 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Matchers RSpec::Matchers.define :have_dep do |*args| @@ -69,7 +70,7 @@ module Spec def lockfile_should_be(expected) should_be_locked spaces = expected[/\A\s+/, 0] || "" - expected.gsub!(/^#{spaces}/, "") + expected = expected.gsub(/^#{spaces}/, "") expect(bundled_app("Gemfile.lock").read).to eq(expected) end end diff --git a/spec/support/path.rb b/spec/support/path.rb index 42eb9f7364..d1f698acbe 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "pathname" module Spec diff --git a/spec/support/permissions.rb b/spec/support/permissions.rb index efdb4a5b28..f5636dd70a 100644 --- a/spec/support/permissions.rb +++ b/spec/support/permissions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Permissions def with_umask(new_umask) diff --git a/spec/support/platforms.rb b/spec/support/platforms.rb index 26753af936..b1dedb05fa 100644 --- a/spec/support/platforms.rb +++ b/spec/support/platforms.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Platforms include Bundler::GemHelpers diff --git a/spec/support/ruby_ext.rb b/spec/support/ruby_ext.rb index 9c5b08c9e5..7f1eabf4b5 100644 --- a/spec/support/ruby_ext.rb +++ b/spec/support/ruby_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class IO def read_available_bytes(chunk_size = 16_384, select_timeout = 0.02) buffer = [] diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb index 2889f44040..64cc41443d 100644 --- a/spec/support/rubygems_ext.rb +++ b/spec/support/rubygems_ext.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rubygems/user_interaction" require "support/path" unless defined?(Spec::Path) @@ -30,9 +31,9 @@ module Spec if !File.exist?(manifest_path) || !(manifest - File.readlines(manifest_path)).empty? FileUtils.rm_rf(Path.base_system_gems) FileUtils.mkdir_p(Path.base_system_gems) - File.open(manifest_path, "w") {|f| f << manifest.join } puts "installing gems for the tests to use..." DEPS.each {|n, v| install_gem(n, v) } + File.open(manifest_path, "w") {|f| f << manifest.join } end ENV["HOME"] = Path.home.to_s @@ -42,7 +43,7 @@ module Spec def self.install_gem(name, version = nil) cmd = "gem install #{name} --no-rdoc --no-ri" - cmd << " --version #{version}" if version + cmd += " --version #{version}" if version system(cmd) || raise("Installing gem #{name} for the tests to use failed!") end diff --git a/spec/support/sometimes.rb b/spec/support/sometimes.rb index 0ab15d974f..1ecbd36e2d 100644 --- a/spec/support/sometimes.rb +++ b/spec/support/sometimes.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Sometimes def run_with_retries(example_to_run, retries) example = RSpec.current_example diff --git a/spec/support/streams.rb b/spec/support/streams.rb index f89c506c93..561b29092b 100644 --- a/spec/support/streams.rb +++ b/spec/support/streams.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "stringio" def capture(*streams) diff --git a/spec/support/sudo.rb b/spec/support/sudo.rb index 2192b09dc8..8c82bb8c0f 100644 --- a/spec/support/sudo.rb +++ b/spec/support/sudo.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module Spec module Sudo def self.present? diff --git a/spec/update/git_spec.rb b/spec/update/git_spec.rb index 1c69918f25..94426b68d9 100644 --- a/spec/update/git_spec.rb +++ b/spec/update/git_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "bundle update" do diff --git a/spec/update/path_spec.rb b/spec/update/path_spec.rb index 79d8caa945..aa220ad60e 100644 --- a/spec/update/path_spec.rb +++ b/spec/update/path_spec.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "spec_helper" describe "path sources" do |