diff options
author | Stefan Lance <stefan@lances.net> | 2015-07-21 14:35:21 -0500 |
---|---|---|
committer | Stefan Lance <stefan@lances.net> | 2015-08-18 09:16:43 -0500 |
commit | b92bdff9bd909cc93e46a87c50e1ec8da3f81ff9 (patch) | |
tree | f6bafb049542d81a230144dd468bb228527e75bb | |
parent | 4e5daf70e56b0321005e47b3d087392274c4922c (diff) | |
download | bundler-b92bdff9bd909cc93e46a87c50e1ec8da3f81ff9.tar.gz |
Replace hard-coded `gems.rb` strings with dynamic gemfile name method
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/cache.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/check.rb | 6 | ||||
-rw-r--r-- | lib/bundler/cli/init.rb | 6 | ||||
-rw-r--r-- | lib/bundler/cli/inject.rb | 4 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 6 | ||||
-rw-r--r-- | lib/bundler/cli/lock.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/package.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/platform.rb | 4 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 20 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 8 | ||||
-rw-r--r-- | lib/bundler/env.rb | 4 | ||||
-rw-r--r-- | lib/bundler/fetcher.rb | 4 | ||||
-rw-r--r-- | lib/bundler/friendly_errors.rb | 2 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver.rb | 8 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 4 | ||||
-rw-r--r-- | lib/bundler/runtime.rb | 2 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 2 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 6 | ||||
-rw-r--r-- | lib/bundler/spec_set.rb | 2 | ||||
-rw-r--r-- | spec/commands/check_spec.rb | 14 | ||||
-rw-r--r-- | spec/install/bundler_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/deploy_spec.rb | 42 | ||||
-rw-r--r-- | spec/other/platform_spec.rb | 4 |
27 files changed, 82 insertions, 82 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 8e6b4644c7..f177a50d47 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -216,7 +216,7 @@ module Bundler default_gemfile.dirname.expand_path rescue GemfileNotFound bundle_dir = default_bundle_dir - raise GemfileNotFound, "Could not locate gems.rb or .bundle/ directory" unless bundle_dir + raise GemfileNotFound, "Could not locate #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} or .bundle/ directory" unless bundle_dir Pathname.new(File.expand_path("..", bundle_dir)) end end diff --git a/lib/bundler/cli/cache.rb b/lib/bundler/cli/cache.rb index 2019cc7e1d..8033500c34 100644 --- a/lib/bundler/cli/cache.rb +++ b/lib/bundler/cli/cache.rb @@ -25,7 +25,7 @@ module Bundler Bundler.settings[:cache_all] = options[:all] if options.key?("all") if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all] - Bundler.ui.warn "Your gems.rb contains path and git dependencies. If you want " \ + Bundler.ui.warn "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} contains path and git dependencies. If you want " \ "to package them as well, please pass the --all flag. This will be the default " \ "on Bundler 2.0." end diff --git a/lib/bundler/cli/check.rb b/lib/bundler/cli/check.rb index fc4d487667..4329e42d68 100644 --- a/lib/bundler/cli/check.rb +++ b/lib/bundler/cli/check.rb @@ -15,7 +15,7 @@ module Bundler definition.validate_ruby! not_installed = definition.missing_specs rescue GemNotFound, VersionConflict - Bundler.ui.error "Bundler can't satisfy your gems.rb's dependencies." + Bundler.ui.error "Bundler can't satisfy your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}'s dependencies." Bundler.ui.warn "Install missing gems with `bundle install`." exit 1 end @@ -26,11 +26,11 @@ module Bundler Bundler.ui.warn "Install missing gems with `bundle install`" exit 1 elsif !Bundler.default_lockfile.exist? && Bundler.settings[:frozen] - Bundler.ui.error "This bundle has been frozen, but there is no gems.locked present" + Bundler.ui.error "This bundle has been frozen, but there is no #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} present" exit 1 else Bundler.load.lock(:preserve_bundled_with => true) unless options[:"dry-run"] - Bundler.ui.info "The gems.rb's dependencies are satisfied" + Bundler.ui.info "#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}'s dependencies are satisfied" end end end diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 937e5b4205..4edd46e6f8 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -9,7 +9,7 @@ module Bundler %w(gems.rb Gemfile).each do |f| if File.exist?(f) - Bundler.ui.error "#{f} already exists at #{Dir.pwd}/#{f}" + Bundler.ui.error "#{f} already exists at #{SharedHelpers.pwd}/#{f}" exit 1 end end @@ -21,14 +21,14 @@ module Bundler exit 1 end spec = Gem::Specification.load(gemspec) - puts "Writing new gems.rb to #{Dir.pwd}/gems.rb" + puts "Writing new gems.rb to #{SharedHelpers.pwd}/gems.rb" File.open("gems.rb", "wb") do |file| file << "# Generated from #{gemspec}\n" file << spec.to_gemfile end else - puts "Writing new gems.rb to #{Dir.pwd}/gems.rb" + puts "Writing new gems.rb to #{SharedHelpers.pwd}/gems.rb" FileUtils.cp(File.expand_path("../../templates/gems.rb", __FILE__), "gems.rb") end end diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb index 7cea2922af..ea403ee2e0 100644 --- a/lib/bundler/cli/inject.rb +++ b/lib/bundler/cli/inject.rb @@ -22,10 +22,10 @@ module Bundler added = Injector.inject(deps) if added.any? - Bundler.ui.confirm "Added to gems.rb:" + Bundler.ui.confirm "Added to #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}:" Bundler.ui.confirm added.map {|g| " #{g}" }.join("\n") else - Bundler.ui.confirm "All injected gems were already present in the gems.rb" + Bundler.ui.confirm "All injected gems were already present in #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}" end end end diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index c83e1d1f09..444a75bff2 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -145,8 +145,8 @@ module Bundler unless Bundler.definition.has_rubygems_remotes? Bundler.ui.warn <<-WARN, :wrap => true - Your gems.rb has no gem server sources. If you need gems that are \ - not already on your machine, add a line like this to your gems.rb: + Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} has no gem server sources. If you need gems that are \ + not already on your machine, add a line like this to your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}: source 'https://rubygems.org' WARN end @@ -171,7 +171,7 @@ module Bundler def dependencies_count_for(definition) count = definition.dependencies.count - "#{count} gems.rb #{count == 1 ? "dependency" : "dependencies"}" + "#{count} #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} #{count == 1 ? "dependency" : "dependencies"}" end def gems_installed_for(definition) diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb index dfe7ef1ef8..f466231707 100644 --- a/lib/bundler/cli/lock.rb +++ b/lib/bundler/cli/lock.rb @@ -8,7 +8,7 @@ module Bundler def run unless Bundler.default_gemfile - Bundler.ui.error "Unable to find a gems.rb to lock" + Bundler.ui.error "Unable to find a #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} to lock" exit 1 end diff --git a/lib/bundler/cli/package.rb b/lib/bundler/cli/package.rb index 713f79c538..5c14e023a1 100644 --- a/lib/bundler/cli/package.rb +++ b/lib/bundler/cli/package.rb @@ -36,7 +36,7 @@ module Bundler Bundler.settings[:cache_all] = options[:all] if options.key?("all") if Bundler.definition.has_local_dependencies? && !Bundler.settings[:cache_all] - Bundler.ui.warn "Your gems.rb contains path and git dependencies. If you want " \ + Bundler.ui.warn "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} contains path and git dependencies. If you want " \ "to package them as well, please pass the --all flag. This will be the default " \ "on Bundler 2.0." end diff --git a/lib/bundler/cli/platform.rb b/lib/bundler/cli/platform.rb index fa33968df5..2b0a4db6be 100644 --- a/lib/bundler/cli/platform.rb +++ b/lib/bundler/cli/platform.rb @@ -23,7 +23,7 @@ module Bundler output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}" if ruby_version - output << "Your gems.rb specifies a Ruby version requirement:\n* #{ruby_version}" + output << "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specifies a Ruby version requirement:\n* #{ruby_version}" begin Bundler.definition.validate_ruby! @@ -32,7 +32,7 @@ module Bundler output << e.message end else - output << "Your gems.rb does not specify a Ruby version requirement." + output << "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} does not specify a Ruby version requirement." end end diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 23ca63c84f..5012ddfbd6 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -325,11 +325,11 @@ module Bundler def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false) msg = "You are trying to install in deployment mode after changing\n" \ - "your gems.rb. Run `bundle install` elsewhere and add the\n" \ + "your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}. Run `bundle install` elsewhere and add the\n" \ "updated gems.locked to version control." unless explicit_flag - msg += "\n\nIf this is a development machine, remove the gems.rb " \ + msg += "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} " \ "freeze \nby running `bundle install --no-deployment`." end @@ -374,9 +374,9 @@ module Bundler end end - msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any? - msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any? - msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any? + msg << "\n\nYou have added to #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}:\n" << added.join("\n") if added.any? + msg << "\n\nYou have deleted from #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}:\n" << deleted.join("\n") if deleted.any? + msg << "\n\nYou have changed in #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}:\n" << changed.join("\n") if changed.any? msg << "\n" raise ProductionError, msg if added.any? || deleted.any? || changed.any? @@ -390,16 +390,16 @@ module Bundler msg = case problem when :engine - "Your Ruby engine is #{actual}, but your gems.rb specified #{expected}" + "Your Ruby engine is #{actual}, but your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specified #{expected}" when :version - "Your Ruby version is #{actual}, but your gems.rb specified #{expected}" + "Your Ruby version is #{actual}, but your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specified #{expected}" when :engine_version - "Your #{Bundler.ruby_version.engine} version is #{actual}, but your gems.rb specified #{ruby_version.engine} #{expected}" + "Your #{Bundler.ruby_version.engine} version is #{actual}, but your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specified #{ruby_version.engine} #{expected}" when :patchlevel if !expected.is_a?(String) - "The Ruby patchlevel in your gems.rb must be a string" + "The Ruby patchlevel in your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} must be a string" else - "Your Ruby patchlevel is #{actual}, but your gems.rb specified #{expected}" + "Your Ruby patchlevel is #{actual}, but your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specified #{expected}" end end diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index bb6a57dbb6..8ab2c7b88a 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -91,7 +91,7 @@ module Bundler end else - Bundler.ui.warn "Your gems.rb lists the gem #{current.name} (#{current.requirement}) more than once.\n" \ + Bundler.ui.warn "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} lists the gem #{current.name} (#{current.requirement}) more than once.\n" \ "You should probably keep only one of them.\n" \ "While it's not a problem now, it could cause errors if you change the version of just one of them later." end @@ -358,11 +358,11 @@ module Bundler # TODO: 2.0 upgrade from setting to default if Bundler.settings[:disable_multisource] - raise GemspecError, "Warning: this gems.rb contains multiple primary sources. " \ + raise GemspecError, "Warning: this #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} contains multiple primary sources. " \ "Each source after the first must include a block to indicate which gems " \ "should come from that source." else - Bundler.ui.deprecate "Your gems.rb contains multiple primary sources. " \ + Bundler.ui.deprecate "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} contains multiple primary sources. " \ "Using `source` more than once without a block is a security risk, and " \ "may result in installing unexpected gems. To resolve this warning, use " \ "a block to indicate which gems should come from the secondary source. " \ @@ -381,7 +381,7 @@ module Bundler def warn_deprecated_git_source(name, repo_string) # TODO: 2.0 remove deprecation Bundler.ui.deprecate "The :#{name} git source is deprecated, and will be removed " \ - "in Bundler 2.0. Add this code to your gems.rb to ensure it continues to work:\n" \ + "in Bundler 2.0. Add this code to your gemfile to ensure it continues to work:\n" \ " git_source(:#{name}) do |repo_name|\n" \ " #{repo_string}\n" \ " end", true diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index c2b2d01efc..694d6d7c6c 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -32,10 +32,10 @@ module Bundler end if print_gemfile - out << "\ngems.rb\n\n" + out << "\n#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}\n\n" out << " " << read_file(Bundler.default_gemfile).gsub(/\n/, "\n ") << "\n" - out << "\n" << "gems.locked\n\n" + out << "\n" << "#{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}\n\n" out << " " << read_file(Bundler.default_lockfile).gsub(/\n/, "\n ") << "\n" end diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index ea909b71b6..d3b50cfe42 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -21,7 +21,7 @@ module Bundler " is a chance you are experiencing a man-in-the-middle attack, but" \ " most likely your system doesn't have the CA certificates needed" \ " for verification. For information about OpenSSL certificates, see" \ - " bit.ly/ruby-ssl. To connect without using SSL, edit your gems.rb" \ + " bit.ly/ruby-ssl. To connect without using SSL, edit your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}" \ " sources and change 'https' to 'http'." end end @@ -30,7 +30,7 @@ module Bundler def initialize(msg = nil) super msg || "Could not load OpenSSL.\n" \ "You must recompile Ruby with OpenSSL support or change the sources in your " \ - "gems.rb from 'https' to 'http'. Instructions for compiling with OpenSSL " \ + "#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} from 'https' to 'http'. Instructions for compiling with OpenSSL " \ "using RVM are available at rvm.io/packages/openssl." end end diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb index fc788c57ee..d3013c7839 100644 --- a/lib/bundler/friendly_errors.rb +++ b/lib/bundler/friendly_errors.rb @@ -26,7 +26,7 @@ module Bundler Bundler.ui.error "\nCould not load OpenSSL." Bundler.ui.warn <<-WARN, :wrap => true You must recompile Ruby with OpenSSL support or change the sources in your \ - gems.rb from 'https' to 'http'. Instructions for compiling with OpenSSL \ + #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} from 'https' to 'http'. Instructions for compiling with OpenSSL \ using RVM are available at http://rvm.io/packages/openssl. WARN Bundler.ui.trace e diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index e984b17767..05da2e1590 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -59,7 +59,7 @@ module Bundler end if dependencies.empty? - Bundler.ui.warn "The gems.rb specifies no dependencies" + Bundler.ui.warn "#{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specifies no dependencies" lock return end diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 799093345f..5fa1f5aae0 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -59,7 +59,7 @@ module Bundler warn_for_outdated_bundler_version rescue ArgumentError => e Bundler.ui.debug(e) - raise LockfileError, "Your lockfile is unreadable. Run `rm gems.locked` " \ + raise LockfileError, "Your lockfile is unreadable. Run `rm #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}` " \ "and then `bundle install` to generate a new lockfile." end diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 1f1b4cce98..fc58129608 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -36,13 +36,13 @@ module Bundler if name == "bundler" && other_bundler_required o << "\n" - o << "This gems.rb requires a different version of Bundler.\n" + o << "This #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} requires a different version of Bundler.\n" o << "Perhaps you need to update Bundler by running `gem install bundler`?\n" end if conflict.locked_requirement o << "\n" o << %(Running `bundle update` will rebuild your snapshot from scratch, using only\n) - o << %(the gems in your gems.rb, which may resolve the conflict.\n) + o << %(the gems in your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}, which may resolve the conflict.\n) elsif !conflict.existing o << "\n" if conflict.requirement_trees.first.size > 1 @@ -273,11 +273,11 @@ module Bundler end def name_for_explicit_dependency_source - "#{Bundler.default_gemfile.basename}" rescue "gems.rb" + Bundler.default_gemfile.basename.to_s rescue "gems.rb" end def name_for_locking_dependency_source - "#{Bundler.default_lockfile.basename}" rescue "gems.locked" + Bundler.default_lockfile.basename.to_s rescue "gems.locked" end def requirement_satisfied_by?(requirement, activated, spec) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index e56d651204..7fb191a572 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -282,7 +282,7 @@ module Bundler if spec.nil? - e = Gem::LoadError.new "#{dep.name} is not part of the bundle. Add it to gems.rb." + e = Gem::LoadError.new "#{dep.name} is not part of the bundle. Add it to #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}." e.name = dep.name if e.respond_to?(:requirement=) e.requirement = dep.requirement @@ -292,7 +292,7 @@ module Bundler raise e elsif dep !~ spec e = Gem::LoadError.new "can't activate #{dep}, already activated #{spec.full_name}. " \ - "Make sure all dependencies are added to gems.rb." + "Make sure all dependencies are added to #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}." e.name = dep.name if e.respond_to?(:requirement=) e.requirement = dep.requirement diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index 00503d7122..aad9ddab7f 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -23,7 +23,7 @@ module Bundler if activated_spec = Bundler.rubygems.loaded_specs(spec.name) and activated_spec.version != spec.version e = Gem::LoadError.new "You have already activated #{activated_spec.name} #{activated_spec.version}, " \ - "but your gems.rb requires #{spec.name} #{spec.version}. Prepending " \ + "but your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} requires #{spec.name} #{spec.version}. Prepending " \ "`bundle exec` to your command may solve this." e.name = spec.name if e.respond_to?(:requirement=) diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index 761d7aca3f..833b19b07a 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -31,7 +31,7 @@ module Bundler end def []=(key, value) - local_config_file or raise GemfileNotFound, "Could not locate gems.rb" + local_config_file or raise GemfileNotFound, "Could not locate #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}" set_key(key, value, @local_config, local_config_file) end diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 4ce08b1ce7..852490dd58 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -98,7 +98,7 @@ module Bundler def find_gemfile given = ENV["BUNDLE_GEMFILE"] return given if given && !given.empty? - find_file("Gemfile", "gems.rb") + find_file("gems.rb", "Gemfile") end def find_file(*names) diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 09806a4878..d0d97432ad 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -107,7 +107,7 @@ module Bundler unless options["branch"] || Bundler.settings[:disable_local_branch_check] raise GitError, "Cannot use local override for #{name} at #{path} because " \ - ":branch is not specified in gems.rb. Specify a branch or use " \ + ":branch is not specified in #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)}. Specify a branch or use " \ "`bundle config --delete` to remove the local override" end @@ -124,13 +124,13 @@ module Bundler if git_proxy.branch != options["branch"] && !Bundler.settings[:disable_local_branch_check] raise GitError, "Local override for #{name} at #{path} is using branch " \ - "#{git_proxy.branch} but gems.rb specifies #{options["branch"]}" + "#{git_proxy.branch} but #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} specifies #{options["branch"]}" end changed = cached_revision && cached_revision != git_proxy.revision if changed && !@unlocked && !git_proxy.contains?(cached_revision) - raise GitError, "The gems.rb lock is pointing to revision #{shortref_for_display(cached_revision)} " \ + raise GitError, "The #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} lock is pointing to revision #{shortref_for_display(cached_revision)} " \ "but the current branch in your local override for #{name} does not contain such commit. " \ "Please make sure your branch is up to date." end diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 07b0df04a6..b6618db65e 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -115,7 +115,7 @@ module Bundler @sorted ||= ([rake] + tsort).compact.uniq rescue TSort::Cyclic => error cgems = extract_circular_gems(error) - raise CyclicDependencyError, "Your gems.rb requires gems that depend" \ + raise CyclicDependencyError, "Your #{Bundler.default_gemfile.relative_path_from(SharedHelpers.pwd)} requires gems that depend" \ " depend on each other, creating an infinite loop. Please remove" \ " either gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again." end diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 72d850c968..fba437acfe 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -9,7 +9,7 @@ describe "bundle check" do bundle :check expect(exitstatus).to eq(0) if exitstatus - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "works with the --gemfile flag when not in the directory" do @@ -20,7 +20,7 @@ describe "bundle check" do Dir.chdir tmp bundle "check --gemfile bundled_app/gems.rb" - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "creates a gems.locked by default if one does not exist" do @@ -103,7 +103,7 @@ describe "bundle check" do bundle "install --without foo" bundle "check" expect(exitstatus).to eq(0) if exitstatus - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "ensures that gems are actually installed and not just cached" do @@ -152,7 +152,7 @@ describe "bundle check" do G bundle :check - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "works with env conditionals" do @@ -183,7 +183,7 @@ describe "bundle check" do G bundle :check - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "outputs an error when the default gems.rb is not found" do @@ -242,7 +242,7 @@ describe "bundle check" do it "returns success" do bundle "check --path vendor/bundle" expect(exitstatus).to eq(0) if exitstatus - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "should write to .bundle/config" do @@ -278,7 +278,7 @@ describe "bundle check" do bundle :install bundle :check expect(exitstatus).to eq(0) if exitstatus - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end it "shows what is missing with the current gems.rb if it is not satisfied" do diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index 19747b5399..e7240a5553 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -144,7 +144,7 @@ describe "bundle install" do simulate_bundler_version "10.0.0" bundle "check" - expect(out).to include("The gems.rb's dependencies are satisfied") + expect(out).to include("gems.rb's dependencies are satisfied") end end end diff --git a/spec/install/deploy_spec.rb b/spec/install/deploy_spec.rb index 07ea760c77..9bed68dfde 100644 --- a/spec/install/deploy_spec.rb +++ b/spec/install/deploy_spec.rb @@ -116,10 +116,10 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(err).to include("deployment mode") - expect(err).to include("You have added to the gems.rb") + expect(err).to include("You have added to gems.rb") expect(err).to include("* rack-obama") - expect(out).not_to include("You have deleted from the gems.rb") - expect(out).not_to include("You have changed in the gems.rb") + expect(out).not_to include("You have deleted from gems.rb") + expect(out).not_to include("You have changed in gems.rb") end it "can have --frozen set via an environment variable" do @@ -132,10 +132,10 @@ describe "install with --deployment or --frozen" do ENV["BUNDLE_FROZEN"] = "1" bundle "install" expect(err).to include("deployment mode") - expect(err).to include("You have added to the gems.rb") + expect(err).to include("You have added to gems.rb") expect(err).to include("* rack-obama") - expect(err).not_to include("You have deleted from the gems.rb") - expect(err).not_to include("You have changed in the gems.rb") + expect(err).not_to include("You have deleted from gems.rb") + expect(err).not_to include("You have changed in gems.rb") end it "can have --frozen set to false via an environment variable" do @@ -148,7 +148,7 @@ describe "install with --deployment or --frozen" do ENV["BUNDLE_FROZEN"] = "false" bundle "install" expect(err).not_to include("deployment mode") - expect(err).not_to include("You have added to the gems.rb") + expect(err).not_to include("You have added to gems.rb") expect(err).not_to include("* rack-obama") end @@ -161,10 +161,10 @@ describe "install with --deployment or --frozen" do bundle "install --frozen" expect(err).to include("deployment mode") - expect(err).to include("You have added to the gems.rb") + expect(err).to include("You have added to gems.rb") expect(err).to include("* rack-obama") - expect(err).not_to include("You have deleted from the gems.rb") - expect(err).not_to include("You have changed in the gems.rb") + expect(err).not_to include("You have deleted from gems.rb") + expect(err).not_to include("You have changed in gems.rb") end it "explodes if you remove a gem and don't check in the lockfile" do @@ -175,9 +175,9 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(err).to include("deployment mode") - expect(err).to include("You have added to the gems.rb:\n* activesupport\n\n") - expect(err).to include("You have deleted from the gems.rb:\n* rack") - expect(err).not_to include("You have changed in the gems.rb") + expect(err).to include("You have added to gems.rb:\n* activesupport\n\n") + expect(err).to include("You have deleted from gems.rb:\n* rack") + expect(err).not_to include("You have changed in gems.rb") end it "explodes if you add a source" do @@ -188,8 +188,8 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(err).to include("deployment mode") - expect(err).to include("You have added to the gems.rb:\n* source: git://hubz.com (at master)") - expect(err).not_to include("You have changed in the gems.rb") + expect(err).to include("You have added to gems.rb:\n* source: git://hubz.com (at master)") + expect(err).not_to include("You have changed in gems.rb") end it "explodes if you unpin a source" do @@ -207,9 +207,9 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(err).to include("deployment mode") - expect(err).to include("You have deleted from the gems.rb:\n* source: #{lib_path("rack-1.0")} (at master)") - expect(err).not_to include("You have added to the gems.rb") - expect(err).not_to include("You have changed in the gems.rb") + expect(err).to include("You have deleted from gems.rb:\n* source: #{lib_path("rack-1.0")} (at master)") + expect(err).not_to include("You have added to gems.rb") + expect(err).not_to include("You have changed in gems.rb") end it "explodes if you unpin a source, leaving it pinned somewhere else" do @@ -230,9 +230,9 @@ describe "install with --deployment or --frozen" do bundle "install --deployment" expect(err).to include("deployment mode") - expect(err).to include("You have changed in the gems.rb:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`") - expect(err).not_to include("You have added to the gems.rb") - expect(err).not_to include("You have deleted from the gems.rb") + expect(err).to include("You have changed in gems.rb:\n* rack from `no specified source` to `#{lib_path("rack")} (at master)`") + expect(err).not_to include("You have added to gems.rb") + expect(err).not_to include("You have deleted from gems.rb") end it "remembers that the bundle is frozen at runtime" do diff --git a/spec/other/platform_spec.rb b/spec/other/platform_spec.rb index bf9d9ba4fe..351540cd65 100644 --- a/spec/other/platform_spec.rb +++ b/spec/other/platform_spec.rb @@ -333,7 +333,7 @@ G bundle :check expect(exitstatus).to eq(0) if exitstatus - expect(out).to eq("The gems.rb's dependencies are satisfied") + expect(out).to eq("gems.rb's dependencies are satisfied") end it "checks fine with any engine" do @@ -352,7 +352,7 @@ G bundle :check expect(exitstatus).to eq(0) if exitstatus - expect(out).to eq("The gems.rb's dependencies are satisfied") + expect(out).to eq("gems.rb's dependencies are satisfied") end end |